users@glassfish.java.net

Problem with JMSXAConnectionFactory

From: <glassfish_at_javadesktop.org>
Date: Sat, 17 May 2008 02:24:47 PDT

Hi,

I have a problem. I'm using [i]GlassFish V2 UR2[/i] for developing a J2EE application with JPA/Hibernate. So, I'm trying to access a JDBC resource over JNDI.
I put all the necessary jars in the classpath but I get the following Exception:

[b]Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jms/spi/xa/JMSXAConnectionFactory
        at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.<init>(J2EETransactionManagerImpl.java:196)
        at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.<init>(J2EETransactionManagerOpt.java:79)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.initialize(ConnectionManagerImpl.java:387)
        at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:128)
        at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:403)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
        at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
        at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
        at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
        at util.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:31)
        at Client.main(Client.java:16)
Caused by: java.lang.ClassNotFoundException: com.sun.jms.spi.xa.JMSXAConnectionFactory
        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 java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 16 more[/b]

That's why I also added the imqjmsra.jar from the 'glassfish\lib\install\applications\jmsra' folder to the classpath and then it works. Okay so far so good. I have the same installation / configuration on another PC without having added this jar to the project classpath and it works too. So, what is wrong / different?

Thanks for your help!
[Message sent by forum member 'konrad1982' (konrad1982)]

http://forums.java.net/jive/thread.jspa?messageID=274978