-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Search: JTA Transaction manager lookup in Websphere
PostPosted: Tue Jun 28, 2011 5:14 pm 
Newbie

Joined: Tue Jun 28, 2011 5:09 pm
Posts: 2
Hi,

I am having trouble reindexing entities using Hibernate Search and the MassIndexer. It looks like Hibernate Search isn't using the same transaction manager lookup scheme that Hibernate Core is using inside my application.

How do I tell Hibernate Search to use the WebsphereExtendedJTATransactionManagerLookup when initiating a transaction?

The full stack trace and some config is below. Perhaps I am just doing something wrong?

Thanks!

Ted

-- hibernate properties file (just part) --
Code:
hibernate.search.default.directory_provider=infinispan
hibernate.search.infinispan.configuration_resourcename=infinispan/test-configuration.xml
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.WebSphereExtendedJTATransactionLookup


-- log output, with a few duplicate stack traces removed for the 4 other collectionsloaders --
Code:
2011-06-28 17:07:50,767 [WebContainer : 6] [] WARN  persistence.jpa.SearchRepositoryJpa - Forcibly (re-) indexing model.feature.Category
2011-06-28 17:07:50,776 [Hibernate Search: entityloader-1] [] ERROR ndexing.IdentifierConsumerEntityProducer - error during batch indexing:
org.hibernate.TransactionException: Could not find UserTransaction in JNDI [java:comp/UserTransaction]
        at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:173)
        at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:149)
        at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:241)
        at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1462)
        at org.hibernate.search.batchindexing.Helper.getTransactionAndMarkForJoin(Helper.java:32)
        at org.hibernate.search.batchindexing.IdentifierConsumerEntityProducer.run(IdentifierConsumerEntityProducer.java:85)
        at org.hibernate.search.batchindexing.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:107)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:736)
Caused by:
javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the server runtime is not able to associate the operation's thread with any J2EE application component.  This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request.  Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application.  Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".]
        at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:428)
        at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:399)
        at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:214)
        at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:154)
        at javax.naming.InitialContext.lookup(InitialContext.java:455)
        at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:163)
        ... 9 more
Caused by:
javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
        at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1178)
        at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1095)
        at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1233)
        at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:395)
        ... 13 more
2011-06-28 17:07:50,777 [Hibernate Search: collectionsloader-4] [] ERROR ndexing.EntityConsumerLuceneworkProducer - error during batch indexing:
org.hibernate.TransactionException: Could not find UserTransaction in JNDI [java:comp/UserTransaction]
        at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:173)
        at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:149)
        at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:241)
        at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1462)
        at org.hibernate.search.batchindexing.Helper.getTransactionAndMarkForJoin(Helper.java:32)
        at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.run(EntityConsumerLuceneworkProducer.java:97)
        at org.hibernate.search.batchindexing.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:107)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:736)
Caused by:
javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the server runtime is not able to associate the operation's thread with any J2EE application component.  This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request.  Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application.  Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".]
        at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:428)
        at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:399)
        at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:214)
        at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:154)
        at javax.naming.InitialContext.lookup(InitialContext.java:455)
        at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:163)
        ... 9 more
Caused by:
javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
        at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1178)
        at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1095)
        at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1233)
        at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:395)
        ... 13 more
2011-06-28 17:07:50,853 [WebContainer : 6] [] WARN  persistence.jpa.SearchRepositoryJpa - Completed indexing.


Last edited by tedpennings on Wed Jun 29, 2011 9:29 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Search: JTA Transaction manager lookup in Websphere
PostPosted: Tue Jun 28, 2011 5:24 pm 
Newbie

Joined: Tue Jun 28, 2011 5:09 pm
Posts: 2
By the way, everything works great in Jetty (our local development environment). The indexes are being updated appropriately by the FullTextIndexEventListener both in Jetty and in Websphere -- it's just the MassIndexer that is having issues in Websphere.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.