persistence@glassfish.java.net

RE: Re: JPA in Jboss 4.0.4 non EJB3

From: Trimble Daniel - dtrimb <Daniel.Trimble_at_acxiom.com>
Date: Wed, 13 Sep 2006 11:24:48 -0500

Yes, I really didit is not bad formatting. At first it wasn't it was in
the Rapidus.ear, but at that point, the entities couldn't even be
instantiated normally in the code.

So, to answer your question, I tried it both ways.

-----Original Message-----
From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM]
Sent: Wednesday, September 13, 2006 11:22 AM
To: persistence_at_glassfish.dev.java.net
Subject: Re: JPA in Jboss 4.0.4 non EJB3

Have you really packaged Entities.jar inside Rapidus.jar or is it just
bad formatting?
Have you tried packaging the contents of Entities.jar inside
Rapidus.jar?

Thanks,
Sahoo
Trimble Daniel - dtrimb wrote:
> This is probably too much information, but I think I covered all
bases.
>
>
> Rapidus.ear
> META-INF
> Rapidus.jar (contains CampaignManager.class)
> META-INF
> Persistence.xml
> ejb-3_0-api.jar
> Entities.jar (contains Campaign.class)
> ojdbc14.jar
> toplink-essentials.jar
> toplink-essentials-agent.jar
>
> -----Original Message-----
> From: Tom Ware [mailto:tom.ware_at_oracle.com]
> Sent: Tuesday, September 12, 2006 12:59 PM
> To: persistence_at_glassfish.dev.java.net
> Subject: Re: JPA in Jboss 4.0.4 non EJB3
>
> Hi Daniel,
>
> Can you provide a bit more information.
>
> What does the stack trace you are seeing look like?
>
> Can you provide the snippet of code you are executing when you see
> your issue?
>
> Can you provide a description of the persistence unit you are
> deploying and how it is packaged?
>
> -Tom
>
> Trimble Daniel - dtrimb wrote:
>
>
>> I think that I understand, but when we try to declare an EMF, it
cannot
>> find the entity classes, even though we can instantiate the class in
>>
> the
>
>> code normally. It is like it doesn't see the classes that are in the
>> classpath?
>>
>> -----Original Message-----
>> From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
>> Sent: Tuesday, September 12, 2006 11:46 AM
>> To: persistence_at_glassfish.dev.java.net
>> Subject: Re: JPA in Jboss 4.0.4 non EJB3
>>
>> By Java SE mode I mean that you'll create EMF using Persistence API,
>> and won't have container-managed EM/EMF.
>>
>> thanks,
>> -marina
>>
>> Trimble Daniel - dtrimb wrote:
>>
>>
>>
>>> So you are saying that it's possible to package the JPA stuff into
my
>>> application and use it, but only in Java SE? I am not sure what Java
>>>
>>>
>>>
>> SE
>>
>>
>>
>>> mode means, pertaining to Jboss.
>>>
>>> Daniel
>>>
>>> -----Original Message-----
>>> From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
>>> Sent: Monday, September 11, 2006 6:41 PM
>>> To: persistence_at_glassfish.dev.java.net
>>> Subject: Re: JPA in Jboss 4.0.4 non EJB3
>>>
>>> Daniel,
>>>
>>> You can use it most probably only in a Java SE mode (as in any other
>>> non-EJB3 compliant container).
>>>
>>> thanks,
>>> -marina
>>>
>>> Trimble Daniel - dtrimb wrote On 09/11/06 08:39,:
>>>
>>>
>>>
>>>
>>>> Is there possibly a way that I can use Java Persistence in a non
EJB3
>>>> instance of Jboss 4.0.4?
>>>>
>>>>
>>>>
>>>> Currently I have tried including the jar's inside of the
application,
>>>> with no luck. I get the following error even though I can
instantiate
>>>> the com.acxiom.Entities.Campaign inside of the application :
>>>>
>>>>
>>>>
>>>> CORBA Error: Exception [TOPLINK-30007] (Oracle TopLink Essentials -
>>>> 2006.6 (Build 060630)):
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
oracle.toplink.essentials.exceptions.PersistenceUnitLoadingExceptionExc
>>
> e
>
>>
>>
>>
>>> ption
>>>
>>>
>>>
>>>
>>>> Description: An exception was thrown while loading class:
>>>> com.acxiom.Entities.Campaign to check whether it implements
@Entity,
>>>> @Embeddable, or @MappedSuperclass.
>>>>
>>>> Internal Exception: java.lang.ClassNotFoundException:
>>>> com.acxiom.Entities.Campaign.]
>>>>
>>>>
>>>>
>>>> It seems like Toplink is having trouble finding my classes even
>>>>
> though
>
>>>> they ARE there available.
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Daniel Trimble
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
***********************************************************************
>>
> *
>
>>
>>
>>
>>> *
>>>
>>>
>>>
>>>
>>>> The information contained in this communication is confidential, is
>>>> intended only for the use of the recipient named above, and may be
>>>> legally privileged.
>>>>
>>>> If the reader of this message is not the intended recipient, you
are
>>>> hereby notified that any dissemination, distribution or copying of
>>>>
>>>>
>>>>
>>> this
>>>
>>>
>>>
>>>
>>>> communication is strictly prohibited.
>>>>
>>>> If you have received this communication in error, please resend
this
>>>> communication to the sender and delete the original message or any
>>>>
>>>>
>>>>
>>> copy
>>>
>>>
>>>
>>>
>>>> of it from your computer system.
>>>>
>>>> Thank you.
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
***********************************************************************
>>
> *
>
>>
>>
>>
>>> *
>>>
>>>
>>>
>
> --
>
>
------------------------------------------------------------------------
>
> 16:47:57,679 WARN [getCampaign] instantiating campaign manager
> 16:47:57,789 ERROR [SOAPFaultExceptionHelper] SOAP request exception
> com.acxiom.RapidusIG.RapidusException: CORBA Error: Exception
[TOPLINK-30007] (O
> racle TopLink Essentials - 2006.6 (Build 060630)):
oracle.toplink.essentials.exc
> eptions.PersistenceUnitLoadingException
> Exception Description: An exception was thrown while loading class:
com.acxiom.E
> ntities.Campaign to check whether it implements @Entity, @Embeddable,
or @Mapped
> Superclass.
> Internal Exception: java.lang.ClassNotFoundException:
com.acxiom.Entities.Campai
> gn.
> at
com.acxiom.RapidusIG.RapidusIGBean.getCampaign(RapidusIGBean.java:248
> )
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
org.jboss.invocation.Invocation.performCall(Invocation.java:359)
> at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
> tatelessSessionContainer.java:237)
> at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
> ke(CachedConnectionInterceptor.java:158)
> at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
> elessSessionInstanceInterceptor.java:169)
> at
org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpoint
> Interceptor.java:90)
> at
org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
> Interceptor.java:63)
> at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
> rceptor.java:121)
> at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
> torCMT.java:350)
> at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
> 81)
> at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
> java:168)
> at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
> at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
> ryFinderInterceptor.java:136)
> at
org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:6
> 48)
> at org.jboss.ejb.Container.invoke(Container.java:954)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
> er.java:155)
> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
> at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
> at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
> java:264)
> at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
> at
org.jboss.ws.server.ServiceEndpointInvokerEJB21.invokeServiceEndpoint
> (ServiceEndpointInvokerEJB21.java:137)
> at
org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvo
> ker.java:118)
> at
org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.jav
> a:234)
> at
org.jboss.ws.server.ServiceEndpointServlet.doPost(ServiceEndpointServ
> let.java:120)
> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:252)
> at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:173)
> at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
> lter.java:96)
> at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:202)
> at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:173)
> at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> alve.java:213)
> at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> alve.java:178)
> at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
> yAssociationValve.java:175)
> at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
> e.java:74)
> at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> ava:126)
> at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> ava:105)
> at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> ve.java:107)
> at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
> a:148)
> at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> :869)
> at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
> rocessConnection(Http11BaseProtocol.java:664)
> at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
> int.java:527)
> at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
> kerThread.java:112)
> at java.lang.Thread.run(Thread.java:595)
> Caused by: Exception [TOPLINK-30007] (Oracle TopLink Essentials -
2006.6 (Build
> 060630)):
oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
> Exception Description: An exception was thrown while loading class:
com.acxiom.E
> ntities.Campaign to check whether it implements @Entity, @Embeddable,
or @Mapped
> Superclass.
> Internal Exception: java.lang.ClassNotFoundException:
com.acxiom.Entities.Campai
> gn
> at
oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.
>
exceptionLoadingClassWhileLookingForAnnotations(PersistenceUnitLoadingEx
ception.
> java:135)
> at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcess
> or.isClassPersistent(PersistenceUnitProcessor.java:662)
> at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcess
> or.buildPersistentClassSet(PersistenceUnitProcessor.java:423)
> at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.bu
> ildEntityList(EntityManagerSetupImpl.java:153)
> at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.pr
> edeploy(EntityManagerSetupImpl.java:474)
> at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.call
> Predeploy(JavaSECMPInitializer.java:145)
> at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.init
> PersistenceUnits(JavaSECMPInitializer.java:225)
> at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.init
> ialize(JavaSECMPInitializer.java:240)
> at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.init
> ializeFromMain(JavaSECMPInitializer.java:277)
> at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.getJ
> avaSECMPInitializer(JavaSECMPInitializer.java:80)
> at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.creat
> eEntityManagerFactory(EntityManagerFactoryProvider.java:118)
> at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.
> java:83)
> at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.
> java:60)
> at
com.acxiom.RapidusIG.CampaignManager.<init>(CampaignManager.java:27)
> at
com.acxiom.RapidusIG.RapidusIGBean.getCampaign(RapidusIGBean.java:217
> )
> ... 51 more
> Caused by: java.lang.ClassNotFoundException:
com.acxiom.Entities.Campaign
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at
oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer$Temp
> EntityLoader.loadClass(JavaSECMPInitializer.java:355)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcess
> or.isClassPersistent(PersistenceUnitProcessor.java:660)
> ... 64 more
>
>
------------------------------------------------------------------------
>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="1.0">
> <persistence-unit name="p1" transaction-type="RESOURCE_LOCAL">
>
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvide
r</provider>
> <class>com.acxiom.Entities.Campaign</class>
> <class>com.acxiom.Entities.FlowComponent</class>
> <class>com.acxiom.Entities.Universe</class>
> <class>com.acxiom.Entities.FlowID</class>
> <properties>
> <!-- Provider-specific connection properties -->
> <property name="toplink.jdbc.driver"
value="oracle.jdbc.driver.OracleDriver"/>
> <property name="toplink.jdbc.url"
value="jdbc:oracle:thin:@xxxx"/>
> <property name="toplink.jdbc.user" value="xxxx"/>
> <property name="toplink.jdbc.password" value="xxxx"/>
> <!-- Provider-specific settings -->
> <!-- <property name="toplink.logging.level" value="INFO"/>
-->
> </properties>
> </persistence-unit>
> </persistence>
>