I have installed my hibernate classes on JBoss using a service approach
as described in Hibernate's document.
At the beginning, I had my "Hibernate Service" called from a web application which is part of of an EAR. Everything worked fine. But I had to move part of the web application (the part that uses Hibernate) to another service. This service has a dependency to start after Hibernate.
Although Hibernate has been correctly started, my new service which tries to update the database within its startService method complains of not finding the UserTransacton in JNDI.
Obciously the name java:comp/UserTransaction is not found (see stack trace) and not already bound when my service starts which was not the case with a Web application. I suspect a missing dependency but which one?
I tried to restart the service after it fails but the same error occurs once again.
Regards
Olivier.
--------------------------------------------------------------------------------
STACK TRACE :
7:43:40,921 ERROR [JTATransaction] Could not find UserTransaction in JNDI
avax.naming.NameNotFoundException: UserTransaction not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:606)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at net.sf.hibernate.transaction.JTATransaction.begin(JTATransaction.java:96)
at net.sf.hibernate.transaction.JTATransactionFactory.beginTransaction(JTATransactionFactory.java:80)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1981)
at fr.mood.persistent.services.StorageManager.begin(StorageManager.java:103)
at fr.mood.repository.Terminator.<init>(Terminator.java:98)
at fr.mood.repository.RWTerminator.<init>(RWTerminator.java:173)
at fr.mood.repository.Repository.lockWrite(Repository.java:115)
at fr.mood.repository.RepositoryFactory.<init>(RepositoryFactory.java:53)
at fr.mood.repository.RepositoryFactory.<clinit>(RepositoryFactory.java:38)
at fr.mood.jboss.MoodService.startService(MoodService.java:65)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
...
[code][/code]
|