users@glassfish.java.net

Container Managed Transaction and Hibernate Search

From: <glassfish_at_javadesktop.org>
Date: Fri, 31 Aug 2007 06:19:06 PDT

Hi,

My application is running on glassfish and make use of hibernate with its extension hibernate search. Ejbs use Container Managed Transaction.

When I persist data in my database, hibernate search try to begin a new transaction, and the following exception is thrown :

[i]javax.naming.NameNotFoundException: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans[/i]


Here is an extract of the exception :
javax.naming.NameNotFoundException: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans
        at com.sun.ejb.containers.BaseContainer.checkUserTransactionLookup(BaseContainer.java:691)
        at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:190)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:337)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:60)
        at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:57)
        at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:193)
        at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1315)
        at org.hibernate.search.backend.impl.TransactionalWorker.performWork(TransactionalWorker.java:33)

Any ideas on how to resolve this issue?
[Message sent by forum member 'will_mad' (will_mad)]

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