persistence@glassfish.java.net

Re: EntityManagerSetupException when accessing db data from session bean

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Thu, 15 Feb 2007 11:17:26 -0800

Hi Ivan,

As Tom already pointed out, you would get into the situation if
something went wrong at deployment time. It is strange that there are no
exceptions in the log at deployment time. I can see that you are running
with JDK 6. Can you you try switching to JDK 5? In any case, would it be
possible for you to attach your netbeans project? That might help one of
us to take a closer look at the situation.

Thanks,
Mitesh

Ivan Matavulj wrote:
> Hello Tom, thanks a lot for your reply.
> I will post the server startup log & bean deployment
> log here, maybe something can be figured out from it.
> Server startup log:
>
> C:/Program Files/Java/jdk1.6.0\bin\java
> -client
> -Xmx512m
> -XX:NewRatio=2
> -Dcom.sun.aas.defaultLogFile=C:/SunAppServer/domains/domain1/logs/server.log
> -Djava.endorsed.dirs=C:/SunAppServer/lib/endorsed
> -Djava.security.policy=C:/SunAppServer/domains/domain1/config/server.policy
> -Djava.security.auth.login.config=C:/SunAppServer/domains/domain1/config/login.conf
> -Dsun.rmi.dgc.server.gcInterval=3600000
> -Dsun.rmi.dgc.client.gcInterval=3600000
> -Djavax.net.ssl.keyStore=C:/SunAppServer/domains/domain1/config/keystore.jks
> -Djavax.net.ssl.trustStore=C:/SunAppServer/domains/domain1/config/cacerts.jks
> -Djava.ext.dirs=C:/Program
> Files/Java/jdk1.6.0/jre/lib/ext;C:/SunAppServer/domains/domain1/lib/ext;C:/SunAppServer/javadb/lib
> -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
> -Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
> -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
> -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
> -Dcom.sun.enterprise.taglisteners=jsf-impl.jar
> -Dcom.sun.aas.classloader.optionalOverrideableChain=appserv-ws.jar,commons-logging.jar,commons-launcher.jar
> -Dcom.sun.aas.classloader.appserverChainJars=admin-cli.jar,admin-cli-ee.jar,dbschema.jar,j2ee-svc.jar
> -Dcom.sun.aas.classloader.serverClassPath.ee=%HADB_HOME%/lib/hadbjdbc4.jar,C:/SunAppServer/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbm.jar,%HADB_HOME%/lib/hadbmgt.jar,C:/SunAppServer/lib/SUNWmfwk/lib/mfwk_instrum_tk.jar
> -Dcom.sun.aas.configName=server-config
> -Ddomain.name=domain1
> -Djmx.invoke.getters=true
> -Dcom.sun.aas.promptForIdentity=true
> -Dcom.sun.aas.classloader.optionalOverrideableChain.ee=
> -Dcom.sun.aas.instanceRoot=C:/SunAppServer/domains/domain1
> -Dcom.sun.aas.domainName=domain1
> -Dcom.sun.aas.classloader.sharedChainJars=javaee.jar,C:/Program
> Files/Java/jdk1.6.0/lib/tools.jar,install/applications/jmsra/imqjmsra.jar,commons-launcher.jar,C:/SunAppServer/imq/lib/jaxm-api.jar,C:/SunAppServer/imq/lib/fscontext.jar,C:/SunAppServer/imq/lib/imqbroker.jar,C:/SunAppServer/imq/lib/imqjmx.jar,C:/SunAppServer/imq/lib/imqxm.jar,C:/SunAppServer/lib/ant/lib/ant.jar,appserv-ws.jar,mail.jar,jsf-api.jar,jsf-impl.jar,appserv-jstl.jar,appserv-env.jar,jmxremote_optional.jar,C:/SunAppServer/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,commons-logging.jar,activation.jar,appserv-rt.jar,appserv-admin.jar,appserv-cmp.jar
> -Dcom.sun.aas.classloader.sharedChainJars.ee=appserv-se.jar,appserv-ee.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbjdbc4.jar,jgroups-all.jar,C:/SunAppServer/lib/SUNWmfwk/lib/mfwk_instrum_tk.jar
> -Djava.util.logging.manager=com.sun.enterprise.server.logging.ServerLogManager
> -Dcom.sun.enterprise.overrideablejavaxpackages=javax.xml.bind,javax.help,javax.portlet
> -Dcom.sun.aas.classloader.serverClassPath=C:/SunAppServer/lib/install/applications/jmsra/imqjmsra.jar,C:/SunAppServer/imq/lib/jaxm-api.jar,C:/SunAppServer/imq/lib/fscontext.jar,C:/SunAppServer/imq/lib/imqbroker.jar,C:/SunAppServer/imq/lib/imqjmx.jar,C:/SunAppServer/lib/ant/lib/ant.jar,C:/SunAppServer/lib/SUNWjdmk/5.1/lib/jdmkrt.jar
> -Dcom.sun.aas.classloader.appserverChainJars.ee=
> -Dcom.sun.aas.configRoot=C:/SunAppServer/config
> -Djava.library.path=C:\SunAppServer\lib;C:\SunAppServer\lib;C:\Program
> Files\Java\jdk1.6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\SunAppServer\lib;C:\SunAppServer\bin;C:\SunAppServer\bin;C:\SunAppServer\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
> Files\Java\jdk1.6.0\bin;C:\mysql50\bin;C:\Program
> Files\QuickTime\QTSystem\;C:\SunAppServer\bin;C:\Sun\AppServer\bin
> -Dcom.sun.aas.instanceName=server
> -Dcom.sun.aas.processLauncher=SE
> -Dcom.sun.aas.installRoot=C:/SunAppServer
> -Dcom.sun.aas.ClassPathPrefix=
> -Dcom.sun.aas.ClassPathSuffix=
> -Dcom.sun.aas.ServerClassPath=
> -cp
> ;C:/SunAppServer/lib/appserv-launch.jar
> com.sun.enterprise.server.PELaunch
> start
> Starting Sun Java System Application Server Platform
> Edition 9.0_01 (build b02-p01) ...
> CORE5098: AS Socket Service Initialization has been
> completed.
> CORE5076: Using [Java HotSpot(TM) Client VM, Version
> 1.6.0] from [Sun Microsystems Inc.]
> SEC1002: Security Manager is OFF.
> ADM0001:MBeanServer initialized successfully
> SEC1143: Loading policy provider
> com.sun.enterprise.security.provider.PolicyWrapper.
> sgmt.service_initialized
> DPL5400:Exception occurred : error in opening zip
> file.
> ADM1079: Initialization of AMX MBeans successful
> ADM1504: Here is the JMXServiceURL for the Standard
> JMXConnectorServer:
> [service:jmx:rmi:///jndi/rmi://vito:8686/jmxrmi].
> This is where the remote administrative clients should
> connect using the standard JMX connectors
> ADM1506: Status of Standard JMX Connector: Active =
> [true]
> SMGT0007: Self Management Rules service is enabled
> Application server startup complete.
> WEB0302: Starting Sun-Java-System/Application-Server.
> WEB0100: Loading web module [__default-admingui] in
> virtual server [__asadmin] at [/]
> WEB0100: Loading web module [adminapp] in virtual
> server [__asadmin] at [/web1]
> WEB0100: Loading web module [admingui] in virtual
> server [__asadmin] at [/asadmin]
> Initializing Sun's JavaServer Faces implementation
> (1.2_02-b03-FCS) for context ''
> Completed initializing Sun's JavaServer Faces
> implementation (1.2_02-b03-FCS) for context ''
> Initializing Sun's JavaServer Faces implementation
> (1.2_02-b03-FCS) for context '/asadmin'
> Completed initializing Sun's JavaServer Faces
> implementation (1.2_02-b03-FCS) for context '/asadmin'
> WEB0712: Starting Sun-Java-System/Application-Server
> HTTP/1.1 on 8080
> WEB0712: Starting Sun-Java-System/Application-Server
> HTTP/1.1 on 8181
> WEB0712: Starting Sun-Java-System/Application-Server
> HTTP/1.1 on 4848
> About to load the system app: __JWSappclients
> WEB0100: Loading web module [__JWSappclients:sys.war]
> in virtual server [server] at [/__JWSappclients]
>
>
>
> EJB DEPLOYMENT LOG:
>
> ADM1064:The upload file at [C:\Documents and
> Settings\Cyvan\Local
> Settings\Temp\s1astempdomain1server-1647709010\TestEJB.jar]
> exists and will be overwritten.
> ADM1006:Uploading the file to:[C:\Documents and
> Settings\Cyvan\Local
> Settings\Temp\s1astempdomain1server-1647709010\TestEJB.jar]
> deployed with moduleid = TestEJB
> ADM1041:Sent the event to instance:[ModuleDeployEvent
> -- enable ejb/TestEJB]
> [TopLink Config]: 2007.02.15
> 12:49:09.890--ServerSession(1615774)--The alias name
> for the entity class [class server.Linija] is being
> defaulted to: Linija.
> naming.bind
> **RemoteBusinessJndiName: HandlerALRemote;
> remoteBusIntf: server.HandlerALRemote
> naming.bind
> LDR5010: All ejb(s) of [TestEJB] loaded successfully!
>
>
> Thanks,
> Ivan
>
> --- Tom Ware <tom.ware_at_oracle.com> wrote:
>
>
>> Hi Ivan,
>>
>> I am not a Sun AS Expert, so maybe someone with
>> more expertise in that
>> area can provide more input, but I can give you an
>> idea of why that
>> error shows up in TopLink Essentials.
>>
>> That error occurs when something in the early
>> initialization of the
>> persistence unit fails. Usually this indicates some
>> kind of packaging
>> or configuration error. Is it possible there is
>> some earlier error
>> message in your log file?
>>
>> -Tom
>>
>> Ivan Matavulj wrote:
>>
>>
>>> Hello,
>>> I have a problem accessing data in db table from a
>>>
>> ejb
>>
>>> 3.0 session bean.
>>> I can successfully instantiate EntityManager for
>>> OrderPU persistence unit, but execution fails when
>>>
>> I
>>
>>> try to make a query:
>>>
>>> @PersistenceContext(unitName="OrderPU")
>>> EntityManager em;
>>> ...
>>> public List findAll() {
>>> Query q = em.createQuery("select object(o) from
>>>
>> Line
>>
>>> as o");
>>> ...
>>> }
>>>
>>>
>>> with the following exception:
>>>
>>> Caused by:
>>> javax.ejb.TransactionRolledbackLocalException:
>>> Exception thrown from bean; nested exception is:
>>> javax.persistence.PersistenceException: Exception
>>> [TOPLINK-28013] (Oracle TopLink Essentials - 2006.8
>>> (Build 060830)):
>>>
>> oracle.toplink.essentials.exceptions.EntityManagerSetupException
>>
>>> Exception Description: Attempted to deploy
>>> PersistenceUnit [OrderPU] for which predeploy
>>>
>> method
>>
>>> either had not called or had failed
>>> at
>>>
>> com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:3588)
>>
>>> at
>>>
>> com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3436)
>>
>>> at
>>>
>> com.sun.ejb.containers.StatefulSessionContainer.postInvokeTx(StatefulSessionContainer.java:2583)
>>
>>> at
>>>
>> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
>>
>>> ... 30 more
>>>
>>> I'm using Sun Java System Application Server
>>>
>> Platform
>>
>>> Edition 9.0_01 (build b14) on Win XP, and building
>>>
>> &
>>
>>> running the example in Netbeans 5.5 (tried also
>>>
>> 551dev
>>
>>> & 6dev).
>>>
>>> I've been stuck with this problem for days, so any
>>> help is appreciated ! .
>>> Thanks a lot !
>>>
>>>
>>>
>>>
>> ____________________________________________________________________________________
>>
>>> Do you Yahoo!?
>>> Everyone is raving about the all-new Yahoo! Mail
>>>
>> beta.
>>
>>> http://new.mail.yahoo.com
>>>
>>>
>>>
>
>
>
>
> ____________________________________________________________________________________
> Don't pick lemons.
> See all the new 2007 cars at Yahoo! Autos.
> http://autos.yahoo.com/new_cars.html
>