Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Thu Jan 19, 2012 7:10 pm 
Newbie

Joined: Mon Oct 17, 2011 1:44 pm
Posts: 14
Hi All,

I am currently using Hibernate Search 3.4.1 with JPA 1.0 and Glassfish 3.1.1. I am getting the below exception while persisting an entity using @Field annotation:

an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.HibernateException: Error while indexing in Hibernate Search (ater transaction completion)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnAfterTx.doAfterTransactionCompletion(EventSourceTransactionContext.java:192)
at org.hibernate.engine.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:591)
at org.hibernate.engine.ActionQueue.afterTransactionCompletion(ActionQueue.java:209)
at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:602)
at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:292)
at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:595)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1010)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:589)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.find(EntityManagerWrapper.java:320)
at com.sonymusic.promo.service.entityfacade.CampaignFinderFacade.findById(CampaignFinderFacade.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5366)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at com.sonymusic.promo.service.interceptor.NullParameterInterceptor.checkForNullParameters(NullParameterInterceptor.java:27)
at sun.reflect.GeneratedMethodAccessor468.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5338)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5326)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy671.findById(Unknown Source)
at com.sonymusic.promo.service.entityfacade.BusinessGroupFacade.findAndCheckNull(BusinessGroupFacade.java:263)
at com.sonymusic.promo.service.entityfacade.BusinessGroupFacade.findOwnerOfCampaign(BusinessGroupFacade.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5366)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at com.sonymusic.promo.service.interceptor.NullParameterInterceptor.checkForNullParameters(NullParameterInterceptor.java:27)
at sun.reflect.GeneratedMethodAccessor468.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5338)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5326)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy692.findOwnerOfCampaign(Unknown Source)
at com.sonymusic.promo.service.entityfacade.AssetFacade.save(AssetFacade.java:735)
at com.sonymusic.promo.service.entityfacade.AssetFacade.save(AssetFacade.java:354)
at com.sonymusic.promo.service.entityfacade.AssetFacade.saveDocumentAsset(AssetFacade.java:808)
at com.sonymusic.promo.service.entityfacade.AssetFacade.save(AssetFacade.java:210)
at com.sonymusic.promo.service.entityfacade.AssetFacade.createCopyrightAssetForCampaign(AssetFacade.java:295)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5366)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at com.sonymusic.promo.service.interceptor.NullParameterInterceptor.checkForNullParameters(NullParameterInterceptor.java:27)
at sun.reflect.GeneratedMethodAccessor468.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5338)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5326)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy660.createCopyrightAssetForCampaign(Unknown Source)
at com.sonymusic.promo.service.entityfacade.CampaignFacade.updateCampaignForCopyRtDocument(CampaignFacade.java:162)
at com.sonymusic.promo.service.entityfacade.CampaignFacade.copyCampaign(CampaignFacade.java:828)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5366)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)
at com.sonymusic.promo.service.interceptor.NullParameterInterceptor.checkForNullParameters(NullParameterInterceptor.java:27)
at sun.reflect.GeneratedMethodAccessor468.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5338)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5326)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:214)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at $Proxy653.copyCampaign(Unknown Source)
at com.sonymusic.promo.admin.campaign.action.CampaignHomeActionBean.copyCampaign(CampaignHomeActionBean.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.sourceforge.stripes.controller.DispatcherHelper$6.intercept(DispatcherHelper.java:442)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)
at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)
at net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:440)
at net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:278)
at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:160)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.annotations.common.AssertionFailure: Access a Sealed WorkQueue which has not been sealed
at org.hibernate.search.backend.WorkQueue.getSealedQueue(WorkQueue.java:87)
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.performWorks(BatchedQueueingProcessor.java:128)
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.afterCompletion(PostTransactionWorkQueueSynchronization.java:102)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnAfterTx.doAfterTransactionCompletion(EventSourceTransactionContext.java:189)

The persistence.xml looks like:

<?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/ ... ce_1_0.xsd">
<persistence-unit name="xyz" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/xyz</jta-data-source>
<properties>
<property name="hibernate.session_factory_name" value="java:hibernate/SessionFactory" />
<property name="jboss.entity.manager.factory.jndi.name" value="java:persistence/EntityManagerFactory" />
<!-- Other configuration -->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup" />
<!--property name="hibernate.show_sql" value="true"/-->
<!--property name="hibernate.format_sql" value="true" /-->

<!-- hibernate search configuration -->

<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider" />
<property name="hibernate.search.default.indexBase" value="/index/read/glassfishv3"/>

</properties>
</persistence-unit>
</persistence>

I was previously using Hibernate Search 3.1.1.GA and the code was working fine. After upgrading to 3.4.1 and related dependencies like upgrading to HIbernate Core 3.6.7.Final I am getting is exception.

What am I doing wrong?

Regards
Arnab


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Mon Jan 23, 2012 5:35 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

this sounds very much like https://hibernate.onjira.com/browse/HSEARCH-578 and https://hibernate.onjira.com/browse/HSEARCH-540.
I would assume there is a problem in the transaction management.

Hard to tell what exactly is going on. How do use the entity manager? do you get hold of it via injection (@PersistenceContext). I assume you are running on Glassfish. I am not sure what use 'jboss.entity.manager.factory.jndi.name' has in this case.

--Hardy


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Mon Jan 23, 2012 11:41 am 
Newbie

Joined: Mon Oct 17, 2011 1:44 pm
Posts: 14
hardy.ferentschik wrote:
Hi,

this sounds very much like https://hibernate.onjira.com/browse/HSEARCH-578 and https://hibernate.onjira.com/browse/HSEARCH-540.
I would assume there is a problem in the transaction management.

Hard to tell what exactly is going on. How do use the entity manager? do you get hold of it via injection (@PersistenceContext). I assume you are running on Glassfish. I am not sure what use 'jboss.entity.manager.factory.jndi.name' has in this case.

--Hardy


Hi Hardy,

Thanks for the reply. I am using stateful sessionbeans and I am getting hold of the EntityManager via @PersistenceContext. I am also using Extended type persistenceContext.

I am using Glassfish 3.1.1. I have mentioned " 'jboss.entity.manager.factory.jndi.name'" by mistake. Sorry for the confusion.

The same code base was running perfectly without any exception previously when I was using Glassfish 2.1.1+Hibernate 3.3.2.GA+Hibernate Search 3.1.1.GA
Has anything related to Transaction management has changed in this newer releases?

Am I missing any Transaction related configuration?

In HSEARCH-578 the problem got resolved while they changed the TransactionManager. Do I need to do something similar?

Regards
Arnab


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Tue Jan 24, 2012 6:11 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

can you try to also set the property: hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory?

--Hardy


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Tue Jan 24, 2012 7:14 pm 
Newbie

Joined: Mon Oct 17, 2011 1:44 pm
Posts: 14
hardy.ferentschik wrote:
Hi,

can you try to also set the property: hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory?

--Hardy


Hi Hardy,

After adding that property I am getting the below exception:


javax.naming.NamingException: Lookup failed for 'java:comp/env/com.authentication.UserAuthenticator/userSearcher' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: No object bound for java:comp/env/com.authentication.UserAuthenticator/userSearcher [Root exception is javax.ejb.EJBException: Couldn't create EntityManager for refName: com.entityfacade.UserSearcher/em; unitname: PromoPersistence]]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:599)
... 65 more
Caused by: javax.naming.NameNotFoundException: No object bound for java:comp/env/com.authentication.UserAuthenticator/userSearcher [Root exception is javax.ejb.EJBException: Couldn't create EntityManager for refName: com.entityfacade.UserSearcher/em; unitname: PromoPersistence]
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:242)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 69 more
Caused by: javax.ejb.EJBException: Couldn't create EntityManager for refName: com.entityfacade.UserSearcher/em; unitname: PromoPersistence
at com.sun.ejb.containers.StatefulSessionContainer.createExtendedEMs(StatefulSessionContainer.java:664)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:242)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 69 more
Caused by: javax.ejb.EJBException: Couldn't create EntityManager for refName: com.entityfacade.UserSearcher/em; unitname: PromoPersis
tence
at com.sun.ejb.containers.StatefulSessionContainer.createExtendedEMs(StatefulSessionContainer.java:664)
at com.sun.ejb.containers.StatefulSessionContainer.createBeanInstance(StatefulSessionContainer.java:584)
at com.sun.ejb.containers.StatefulSessionContainer.createEJBLocalBusinessObjectImpl(StatefulSessionContainer.java:532)
at com.sun.ejb.containers.BaseContainer.createEJBLocalBusinessObjectImpl(BaseContainer.java:2486)
at com.sun.ejb.containers.EJBLocalHomeImpl.createEJBLocalBusinessObjectImpl(EJBLocalHomeImpl.java:117)
at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:177)
at $Proxy261.create(Unknown Source)
at com.sun.ejb.EJBUtils.resolveEjbRefObject(EJBUtils.java:366)
at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:190)
at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbReferenceProxy.create(ComponentEnvManagerImpl.java:1106)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:776)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:172)
... 70 more
Caused by: javax.persistence.PersistenceException: org.hibernate.TransactionException: Could not find UserTransaction in JNDI [java:comp/UserTransaction]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1215)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1148)
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1083)
at org.hibernate.ejb.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:163)
at org.hibernate.ejb.EntityManagerImpl.<init>(EntityManagerImpl.java:84)
at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:112)
at com.sun.ejb.containers.StatefulSessionContainer.createExtendedEMs(StatefulSessionContainer.java:656)
... 82 more
Caused by: 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.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:997)
... 86 more
Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/UserTransaction' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:163)
... 90 more
Caused by: javax.naming.NameNotFoundException: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans
at com.sun.ejb.containers.BaseContainer.checkUserTransactionLookup(BaseContainer.java:838)
at com.sun.ejb.EjbInvocation.userTransactionLookupAllowed(EjbInvocation.java:427)
at com.sun.enterprise.transaction.TransactionNamingProxy.checkUserTransactionLookupAllowed(TransactionNamingProxy.java:162)
at com.sun.enterprise.transaction.TransactionNamingProxy.handle(TransactionNamingProxy.java:135)
at com.sun.enterprise.naming.impl.NamedNamingObjectManager.tryNamedProxies(NamedNamingObjectManager.java:89)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:177)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498)
... 94 more
|#]


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Wed Jan 25, 2012 6:04 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Sorry my fault, try hibernate.transaction.factory_class=org.hibernate.transaction.CMTTransactionFactory.
See also https://community.jboss.org/wiki/Sessio ... ith_EJBCMT
That should really do it :-)


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Wed Jan 25, 2012 12:54 pm 
Newbie

Joined: Mon Oct 17, 2011 1:44 pm
Posts: 14
hardy.ferentschik wrote:
Sorry my fault, try hibernate.transaction.factory_class=org.hibernate.transaction.CMTTransactionFactory.
See also https://community.jboss.org/wiki/Sessio ... ith_EJBCMT
That should really do it :-)


Hi Hardy,

I added the configuration you mentioned. I am getting the following warning through out the log and no transaction are going through:


[#|2012-01-25T11:51:44.711-0500|WARNING|glassfish3.1.1|org.hibernate.ejb.AbstractEntityManagerImpl|_ThreadID=26;_ThreadName=Thread-2;|Cannot join transaction: do not override hibernate.transaction.factory_class|#]

[#|2012-01-25T11:51:44.712-0500|WARNING|glassfish3.1.1|org.hibernate.ejb.AbstractEntityManagerImpl|_ThreadID=26;_ThreadName=Thread-2;|Cannot join transaction: do not override hibernate.transaction.factory_class|#]

[#|2012-01-25T11:51:44.712-0500|WARNING|glassfish3.1.1|org.hibernate.ejb.AbstractEntityManagerImpl|_ThreadID=26;_ThreadName=Thread-2;|Cannot join transaction: do not override hibernate.transaction.factory_class|#]

[#|2012-01-25T11:51:44.713-0500|WARNING|glassfish3.1.1|org.hibernate.ejb.AbstractEntityManagerImpl|_ThreadID=26;_ThreadName=Thread-2;|Cannot join transaction: do not override hibernate.transaction.factory_class|#]

[#|2012-01-25T11:51:44.713-0500|WARNING|glassfish3.1.1|org.hibernate.ejb.AbstractEntityManagerImpl|_ThreadID=26;_ThreadName=Thread-2;|Cannot join transaction: do not override hibernate.transaction.factory_class|#]

[#|2012-01-25T11:51:44.713-0500|WARNING|glassfish3.1.1|org.hibernate.ejb.AbstractEntityManagerImpl|_ThreadID=26;_ThreadName=Thread-2;|Cannot join transaction: do not override hibernate.transaction.factory_class|#]

This is how my persistence.xml looks:

<?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/ ... ce_1_0.xsd">
<persistence-unit name="xyz" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/xyz</jta-data-source>
<properties>

<!-- Other configuration -->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

<!-- Transaction configuration -->
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup" />
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory"/>

<!--property name="hibernate.show_sql" value="true"/-->
<!--property name="hibernate.format_sql" value="true" /-->

<!-- hibernate search configuration -->
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider" />
<property name="hibernate.search.default.indexBase" value="/index/read/glassfishv3"/>

</properties>
</persistence-unit>
</persistence>

Please help.

Regards
Arnab


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Wed Jan 25, 2012 7:39 pm 
Newbie

Joined: Mon Oct 17, 2011 1:44 pm
Posts: 14
Hi Hardy,

If I dont add the property hibernate.transaction.factory_class in persistence it XML by default org.hibernate.ejb.transaction.JoinableCMTTransactionFactory is selected. I get the below message in the log:

|glassfish3.1.1|org.hibernate.transaction.TransactionFactoryFactory|_ThreadID=90;_ThreadName=Thread-2;|Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory

Thanks
Arnab


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Thu Jan 26, 2012 6:23 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Ok, thanks. Seems we finally got the right combination of settings.


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Thu Jan 26, 2012 9:40 am 
Newbie

Joined: Mon Oct 17, 2011 1:44 pm
Posts: 14
hardy.ferentschik wrote:
Ok, thanks. Seems we finally got the right combination of settings.


Hi Hardy,

Sorry for the confusion but the problem is not resolved. I meant to say was Glassfish is auto detecting the Transaction factory class which is "org.hibernate.ejb.transaction.JoinableCMTTransactionFactory"but am still getting the same issue.I am receiving the same Assertion failure exception.

Thanks
Arnab


Top
 Profile  
 
 Post subject: Re: Assertion failure error while using Hibernate Search 3.4.1
PostPosted: Tue Jan 31, 2012 6:47 pm 
Newbie

Joined: Mon Oct 17, 2011 1:44 pm
Posts: 14
Hi Hardy,

Any update on this issue?

Regards
Arnab


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 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.