[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [eclipselink-users] NoClassDefFoundError: javax/transaction/Synchronization - EclipseLink JPA on JBoss/GlassFish
|
Miroslav,
I don't seem to have problems running an EclipseLink JPA insert and select on a JTA datasource on either GlassFish 2 or JBoss 4 - I used target-server="SunAS9" for GlassFish.
To help out, I was able to run the following configurations on GlassFish V2 build 50 and JBoss 4.2.2GA.
My application sets up a stateless session bean to hold an entitymanager.
The entitymanager is container managed and does not require any entityManager.getTransaction().begin()|commit() calls by using
@PersistenceContext(unitName="unified",type=PersistenceContextType.TRANSACTION)
The servlet does an insert of a new Entity and then queries the database for all existing entities.
See the following 2 wiki tutorial pages for details on the configuration
http://wiki.eclipse.org/EclipseLink/Examples/JPA/GlassFishV2_Web_Tutorial
http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial
Mohsen,
I am running the same configuration for JBoss as yourself - no target-server, SessionCustomizer for jndi STRING_LOOKUP change.
However i am using a eclipselink.server.platform.class.name="JBoss" I will checkout what is up with using target-server="JBoss" - thanks for the heads up on this.
GlassFish
----------------------
GlassFish V2 running a JEE5 EclipseLink JPA EAR application with container managed entities doing read/writes against a JTA datasource
My client is a @EJB injected stateless session bean from the ejb.jar containing the entitymanager on a servlet
EclipseLink JAR location on GlassFish V2 = $GLASSFISH_HOME/lib
persistence.xml:
<persistence-unit name="unified" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>oracle10RemoteDS</jta-data-source>
<properties>
<property name="eclipselink.target-server" value="SunAS9"/>
JBoss
----------------------
JBoss V2 running a JEE5 EclipseLink JPA EAR application with container managed entities doing read/writes against a JTA datasource
My client is a servlet with a (non-injected @EJB) jndi lookup of a stateless session bean from the ejb.jar containing the entitymanager
public static final String APPLICATION_SERVICE_JNDI_NAME = "UnifiedJBossEAR/ApplicationService/local";
EclipseLink JAR location on JBoss = $JBOSS_HOME/server/default/lib
persistence.xml:
<persistence-unit name="unifiedJBoss" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:/XAOracleDS</jta-data-source>
<properties>
<property name="eclipselink.server.platform.class.name" value="JBoss"/>
<property name="eclipselink.weaving" value="false"/>
<property name="eclipselink.session.customizer" value="org.eclipse.persistence.example.unified.integration.JPAEclipseLinkSessionCustomizer"/>
Session Bean EM container:
@Local @Stateless
public class ApplicationService implements ApplicationServiceLocal {
@PersistenceContext(unitName="unified",type=PersistenceContextType.TRANSACTION)
private EntityManager entityManager;
GlassFish logs
---------------------------------
#|2008-09-23T17:18:55.574-0400|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;|
Created new entity: org.eclipse.persistence.example.unified.business.StatLabel@19005c4|#]
[#|2008-09-23T17:18:55.574-0400|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;|
>ApplicationService persisting: org.eclipse.persistence.example.unified.business.StatLabel@19005c4 on EM: com.sun.enterprise.util.EntityManagerWrapper@6ac42f|#]
[#|2008-09-23T17:18:55.574-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.connection|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|client acquired|#]
[#|2008-09-23T17:18:55.574-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|TX binding to tx mgr, status=STATUS_ACTIVE|#]
[#|2008-09-23T17:18:55.574-0400|FINEST|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|PERSIST operation called on: org.eclipse.persistence.example.unified.business.StatLabel@19005c4.|#]
[#|2008-09-23T17:18:55.590-0400|FINEST|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.query|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|Execute query ValueReadQuery()|#]
[#|2008-09-23T17:18:55.590-0400|FINEST|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.connection|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|reconnecting to external connection pool|#]
[#|2008-09-23T17:18:55.590-0400|FINE|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.sql|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|SELECT STAT_LABEL_SEQ.NEXTVAL FROM DUAL|#]
[#|2008-09-23T17:18:55.590-0400|FINEST|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.sequencing|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|sequencing preallocation for STAT_LABEL_SEQ: objects: 25 , first: 2,501, last: 2,525|#]
[#|2008-09-23T17:18:55.590-0400|FINEST|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.sequencing|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|assign sequence to the object (2,501 -> org.eclipse.persistence.example.unified.business.StatLabel@19005c4)|#]
[#|2008-09-23T17:18:55.590-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|TX beforeCompletion callback, status=STATUS_ACTIVE|#]
[#|2008-09-23T17:18:55.605-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|begin unit of work commit|#]
[#|2008-09-23T17:18:55.605-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|TX beginTransaction, status=STATUS_ACTIVE|#]
[#|2008-09-23T17:18:55.605-0400|FINEST|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.query|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|Execute query InsertObjectQuery(org.eclipse.persistence.example.unified.business.StatLabel@19005c4)|#]
[#|2008-09-23T17:18:55.621-0400|FINEST|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.connection|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|reconnecting to external connection pool|#]
[#|2008-09-23T17:18:55.621-0400|FINE|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.sql|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|INSERT INTO STAT_LABEL (ID, REVISION, DATE_STAMP) VALUES (?, ?, ?)
bind => [2501, null, 2009-09-23]|#]
[#|2008-09-23T17:18:55.652-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|TX afterCompletion callback, status=COMMITTED|#]
[#|2008-09-23T17:18:55.652-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|end unit of work commit|#]
[#|2008-09-23T17:18:55.652-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.transaction|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|release unit of work|#]
[#|2008-09-23T17:18:55.652-0400|FINER|sun-appserver9.1|org.eclipse.persistence.session.eclipselinkwls.connection|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=fad2d9fe-aba0-47a6-abc8-6ee7fed8ae5f;|client released|#]
JBoss logs
-------------------------------
16:52:43,485 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=unifiedEAR.ear,jar=UnifiedJBossEJB.jar,name=ApplicationService,service=EJB3 with dependencies:
16:52:43,485 INFO [JmxKernelAbstraction] persistence.units:ear=unifiedEAR.ear,jar=UnifiedJBossEJB.jar,unitName=unifiedJBoss
16:52:43,954 INFO [EJBContainer] STARTED EJB: org.eclipse.persistence.example.unified.business.ApplicationService ejbName: ApplicationService
16:58:25,105 INFO [STDOUT] [EL Finer]: 2008.09.23 16:58:25.090--ServerSession(23836222)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--client acquired
16:58:25,105 INFO [STDOUT] [EL Finer]: 2008.09.23 16:58:25.105--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX binding to tx mgr, status=STATUS_ACTIVE
16:58:25,105 INFO [STDOUT] [EL Finest]: 2008.09.23 16:58:25.105--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--PERSIST operation called on: org.eclipse.persistence.example.unified.business.StatLabel@a98e77.
16:58:25,105 INFO [STDOUT] [EL Finest]: 2008.09.23 16:58:25.105--ClientSession(8591756)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Execute query ValueReadQuery()
16:58:25,105 INFO [STDOUT] [EL Finest]: 2008.09.23 16:58:25.105--ServerSession(23836222)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--reconnecting to external connection pool
16:58:25,105 INFO [STDOUT] [EL Fine]: 2008.09.23 16:58:25.105--ServerSession(23836222)--Connection(16932767)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--SELECT STAT_LABEL_SEQ_GENERATOR.NEXTVAL FROM DUAL
16:58:25,137 INFO [STDOUT] [EL Finest]: 2008.09.23 16:58:25.137--ServerSession(23836222)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--sequencing preallocation for STAT_LABEL_SEQ_GENERATOR: objects: 25 , first: 2,501, last: 2,525
16:58:25,137 INFO [STDOUT] [EL Finest]: 2008.09.23 16:58:25.137--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--assign sequence to the object (2,501 -> org.eclipse.persistence.example.unified.business.StatLabel@a98e77)
16:58:25,137 INFO [STDOUT] [EL Finer]: 2008.09.23 16:58:25.137--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX beforeCompletion callback, status=STATUS_ACTIVE
16:58:25,137 INFO [STDOUT] [EL Finer]: 2008.09.23 16:58:25.137--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--begin unit of work commit
16:58:25,137 INFO [STDOUT] [EL Finer]: 2008.09.23 16:58:25.137--ClientSession(8591756)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX beginTransaction, status=STATUS_ACTIVE
16:58:25,137 INFO [STDOUT] [EL Finest]: 2008.09.23 16:58:25.137--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Execute query InsertObjectQuery(org.eclipse.persistence.example.unified.business.StatLabel@a98e77)
16:58:25,137 INFO [STDOUT] [EL Finest]: 2008.09.23 16:58:25.137--ClientSession(8591756)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--reconnecting to external connection pool
16:58:25,137 INFO [STDOUT] [EL Fine]: 2008.09.23 16:58:25.137--ClientSession(8591756)--Connection(5167690)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--INSERT INTO STAT_LABEL (ID, DATE_STAMP) VALUES (?, ?)
bind => [2501, 2009-09-23]
16:58:25,215 INFO [STDOUT] [EL Finer]: 2008.09.23 16:58:25.215--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX afterCompletion callback, status=COMMITTED
16:58:25,230 INFO [STDOUT] [EL Finer]: 2008.09.23 16:58:25.230--UnitOfWork(25417229)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--end unit of work commit
16:58:25,230 INFO [STDOUT] Persisted new entity: org.eclipse.persistence.example.unified.business.StatLabel@11112055(id: 2501 date: 2009-09-23 packages: {[]} methods: {[]} fields: {[]} classes: {[]} methodParams: {[]})
thank you
/michael
-----Original Message-----
From: Mohsen Saboorian [mailto:mohsens@xxxxxxxxx]
Sent: Tuesday, September 23, 2008 13:56
To: EclipseLink User Discussions
Subject: Re: [eclipselink-users] NoClassDefFoundError: javax/transaction/Synchronization
I had a similar issue with terget-server set to JBoss, so I just
dropped that property, keeping transaction-type="JTA", setting a
session customizer (to make it work with JNDI lookup), and setting
<jta-data-source> to something like this: java:myds (with a *-ds.xml
visible to JBoss).
Mohsen.
On Tue, Sep 23, 2008 at 10:49 AM, Miroslav Kubíček
<miroslav.kubicek@xxxxxxxxx> wrote:
> I put my eclipselink.jar (and javaee.jar) almost everywhere... I also do
> have it in my $GLASSFISH_HOME/lib dir.
>
> I'll be glad for any ideas...
>
> Options that have left are of an experimental nature - to reinstall the
> server / try new build of eclipselink etc... But I dont think it is likely
> to solve this.
>
> Thanks,
> rgds
> Miroslav
>
>
> On 9/23/08, Mitesh Meswani <Mitesh.Meswani@xxxxxxx> wrote:
>>
>> It seems the classloader that loads EclipseLink classes is not able to
>> access javax/transaction/Synchronization. Which is strange. Where are you
>> putting eclipselink.jar? Can you try putting in $GLASSFISH_HOME/lib dir.
>>
>> Regards,
>> Mitesh
>>
>> Miroslav Kubíc(ek wrote:
>>>
>>> I have javaee.jar in my classpath (both client and ejb module) and when I
>>> swich to TopLink (just change persistence.xml) the error does not occur.
>>> Therefore I am trying to find out whether it is some silly problem with my
>>> classpath or some eclipselink issue.
>>> For testing ejb layer I have simple client using JUnit.
>>>
>>> Furthermore, eclipselink first worked, but container managed transactions
>>> were not (but I was able to retrieve data and to manualy manage
>>> transactions).
>>> Then I added <property name="eclipselink.target-server" value="SunAS9"/>
>>> to persistence.xml. Then this error occured.
>>>
>>> source code is below,
>>> stack trace is here:
>>>
>>> compile:
>>> compile-test-single:
>>> Testsuite: clinttest.junit.TestEJB
>>> java.rmi.RemoteException: null; nested exception is:
>>> java.lang.NoClassDefFoundError: javax/transaction/Synchronization)
>>> Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 4,42 sec
>>>
>>> Testcase: testEJBUpdate(clinttest.junit.TestEJB): Caused an ERROR
>>> nested exception is: java.rmi.ServerException: RemoteException occurred
>>> in server thread; nested exception is:
>>> java.rmi.RemoteException: null; nested exception is:
>>> java.lang.NoClassDefFoundError: javax/transaction/Synchronization
>>> javax.ejb.EJBException: nested exception is: java.rmi.ServerException:
>>> RemoteException occurred in server thread; nested exception is:
>>> java.rmi.RemoteException: null; nested exception is:
>>> java.lang.NoClassDefFoundError: javax/transaction/Synchronization
>>> java.rmi.ServerException: RemoteException occurred in server thread;
>>> nested exception is:
>>> java.rmi.RemoteException: null; nested exception is:
>>> java.lang.NoClassDefFoundError: javax/transaction/Synchronization
>>> at
>>> com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
>>> at
>>> com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
>>> at
>>> com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
>>> at
>>> com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
>>> at
>>> org.testejb.toplink.__CompaniesFacadeRemote_Remote_DynamicStub.find(org/testejb/toplink/__CompaniesFacadeRemote_Remote_DynamicStub.java)
>>> at
>>> org.testejb.toplink._CompaniesFacadeRemote_Wrapper.find(org/testejb/toplink/_CompaniesFacadeRemote_Wrapper.java)
>>> at clinttest.junit.TestEJB.setUp(TestEJB.java:37)
>>> Caused by: java.rmi.RemoteException: null; nested exception is:
>>> java.lang.NoClassDefFoundError: javax/transaction/Synchronization
>>> at
>>> com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:251)
>>> at
>>> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1386)
>>> at
>>> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
>>> at
>>> com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:210)
>>> at
>>> com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:117)
>>> at $Proxy54.find(Unknown Source)
>>> at
>>> com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:154)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
>>> at
>>> com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
>>> at
>>> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
>>> at
>>> com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
>>> Caused by: java.lang.NoClassDefFoundError:
>>> javax/transaction/Synchronization
>>> at java.lang.ClassLoader.defineClass1(Native Method)
>>> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>>> at
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>>> at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>>> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>>> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>>> at
>>> org.eclipse.persistence.transaction.JTATransactionController.<init>(JTATransactionController.java:60)
>>> at
>>> org.eclipse.persistence.transaction.sunas.SunAS9TransactionController.<init>(SunAS9TransactionController.java:36)
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>>> at java.lang.Class.newInstance0(Class.java:350)
>>> at java.lang.Class.newInstance(Class.java:303)
>>> at
>>> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(PrivilegedAccessHelper.java:331)
>>> at
>>> org.eclipse.persistence.platform.server.ServerPlatformBase.initializeExternalTransactionController(ServerPlatformBase.java:241)
>>> at
>>> org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.preConnectDatasource(DatabaseSessionImpl.java:628)
>>> at
>>> org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:567)
>>> at
>>> org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:209)
>>> at
>>> org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:246)
>>> at
>>> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:69)
>>> at
>>> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:118)
>>> at
>>> org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:108)
>>> at
>>> com.sun.enterprise.util.EntityManagerWrapper._getDelegate(EntityManagerWrapper.java:326)
>>> at
>>> com.sun.enterprise.util.EntityManagerWrapper.find(EntityManagerWrapper.java:546)
>>> at org.testejb.toplink.CompaniesFacade.find(CompaniesFacade.java:35)
>>> at
>>> com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
>>> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
>>> at
>>> com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
>>> at
>>> com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
>>> at
>>> com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:203)
>>> javax.ejb.EJBException: nested exception is: java.rmi.ServerException:
>>> RemoteException occurred in server thread; nested exception is:
>>> java.rmi.RemoteException: null; nested exception is:
>>> java.lang.NoClassDefFoundError: javax/transaction/Synchronization
>>> at
>>> org.testejb.toplink._CompaniesFacadeRemote_Wrapper.find(org/testejb/toplink/_CompaniesFacadeRemote_Wrapper.java)
>>> at clinttest.junit.TestEJB.setUp(TestEJB.java:37)
>>>
>>>
>>> Test clinttest.junit.TestEJB FAILED
>>>
>>> ----------------------------------------
>>> ----- session facade file is here:
>>> ----------------------------------------
>>>
>>> package org.testejb.toplink;
>>>
>>> import java.util.List;
>>> import javax.ejb.Stateless;
>>> import javax.persistence.EntityManager;
>>> import javax.persistence.PersistenceContext;
>>>
>>> @Stateless
>>> public class CompaniesFacade implements CompaniesFacadeRemote {
>>> @PersistenceContext
>>> private EntityManager em;
>>>
>>> public void create(Companies companies) {
>>> em.persist(companies);
>>> }
>>>
>>> public void edit(Companies companies) {
>>> em.merge(companies);
>>> }
>>>
>>> public void remove(Companies companies) {
>>> em.remove(em.merge(companies));
>>> }
>>>
>>> public Companies find(Object id) {
>>> return em.find(org.testejb.toplink.Companies.class, id);
>>> }
>>>
>>> public List<Companies> findAll() {
>>> return em.createQuery("select object(o) from Companies as
>>> o").getResultList();
>>> }
>>>
>>> }
>>>
>>> --------------------------------------
>>> ---------------------junit test file:
>>> --------------------------------------
>>>
>>> package clinttest.junit;
>>>
>>> import org.junit.After;
>>> import org.junit.AfterClass;
>>> import org.junit.Before;
>>> import org.junit.BeforeClass;
>>> import org.junit.Test;
>>> import javax.naming.InitialContext;
>>> import junit.framework.TestCase;
>>> import org.junit.Assert;
>>> import org.testejb.toplink.Companies;
>>> import org.testejb.toplink.CompaniesFacadeRemote;
>>>
>>> /**
>>> *
>>> * @author kubicekm
>>> */
>>> public class TestEJB extends TestCase{
>>> private CompaniesFacadeRemote compFacade;
>>> private Companies c46;
>>>
>>> public TestEJB() {
>>> }
>>>
>>> @BeforeClass
>>> public static void setUpClass() throws Exception {
>>> }
>>>
>>> @AfterClass
>>> public static void tearDownClass() throws Exception {
>>> }
>>>
>>> @Before
>>> public void setUp() throws Exception{
>>> InitialContext ctx = new InitialContext();
>>> compFacade = (CompaniesFacadeRemote)
>>> ctx.lookup("org.testejb.toplink.CompaniesFacadeRemote");
>>> c46 = compFacade.find(46);
>>> }
>>>
>>> @After
>>> public void tearDown() {
>>> }
>>>
>>> @Test
>>> public void testEJBUpdate (){
>>> String oldNotes = c46.getNotes();
>>> c46.setNotes(oldNotes.concat(" edited"));
>>> compFacade.edit(c46);
>>> Companies c46edited = compFacade.find(46);
>>> Assert.assertTrue(!oldNotes.equals(c46edited.getNotes()));
>>> Assert.assertEquals(c46, c46edited); //should still equal, ids equal
>>> }
>>> }
>>>
>>>
>>>
>>> On Mon, Sep 22, 2008 at 3:42 PM, James Sutherland <jamesssss@xxxxxxxxx
>>> <mailto:jamesssss@xxxxxxxxx>> wrote:
>>>
>>>
>>> Ensure you have the JTA or JavaEE jar on your classpath, including
>>> your
>>> client classpath.
>>>
>>> Also ensure it is visible to EclipseLink, where did you put the
>>> eclipselink.jar in your server? Is the error raised from
>>> EclipseLink or
>>> somewhere else, include the full stack and enable logging in
>>> EclipseLink to
>>> see the error on the server side.
>>>
>>>
>>>
>>> miroslav. wrote:
>>> >
>>> > Hello,
>>> >
>>> > please could anyone help me - I am receiving this error:
>>> >
>>> > java.rmi.RemoteException: null; nested exception is:
>>> > java.lang.NoClassDefFoundError: javax/transaction/Synchronization
>>> >
>>> > I'm using glassfish 2u2, eclipselink, Oracle db and NetBeans 6.1
>>> as IDE.
>>> > I've got a simple application: an entity and a stateless session
>>> facade.
>>> > It does work when using default TopLink, but when I swich to
>>> Eclipselink,
>>> > container managed transactions stop working and I get this
>>> error. The
>>> > error is fired when I invoke first EntityManager.find method.
>>> >
>>> > my persistence.xml:
>>> >
>>> > <?xml version="1.0" encoding="UTF-8"?>
>>> > <persistence version="1.0"
>>> xmlns="http://java.sun.com/xml/ns/persistence"
>>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
>>> > http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
>>> > <persistence-unit name="TestEJB_TLPU" transaction-type="JTA">
>>> > <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>>> > <jta-data-source>hpd</jta-data-source>
>>> > <properties>
>>> > <property name="eclipselink.target-server" value="SunAS9"/>
>>> > </properties>
>>> > </persistence-unit>
>>> > </persistence>
>>> >
>>> > Thanks very much in advance
>>> > Rgds
>>> > Miroslav
>>> >
>>> >
>>>
>>>
>>> -----
>>> ---
>>> http://wiki.eclipse.org/User:James.sutherland.oracle.com James
>>> Sutherland
>>> http://www.eclipse.org/eclipselink/
>>> EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
>>> TopLink
>>> Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
>>> http://wiki.oracle.com/page/TopLink TopLink
>>> Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48
>>> TopLink ,
>>> http://www.nabble.com/EclipseLink-f26430.html EclipseLink
>>> Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
>>> --
>>> View this message in context:
>>>
>>> http://www.nabble.com/NoClassDefFoundError%3A-javax-transaction-Synchronization-tp19604774p19608204.html
>>> Sent from the EclipseLink - Users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>