-->
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.  [ 10 posts ] 
Author Message
 Post subject: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Sun Dec 27, 2009 4:28 pm 
Beginner
Beginner

Joined: Mon Dec 21, 2009 3:43 pm
Posts: 24
Jboss 4.2.3.GA comes with

hibernate-core 3.2.4.sp1
hibernate annotations 3.2.1.GA
hibernate-entitymanager 3.2.1.GA

I found that the best version of hibernate-search to use (following the compatibility matrix) is Hibernate Search 3.0.1.GA.

When I download that version of search the zip file comes with lucene-core version 2.3, and hibernate-commons-annotations version 3.0.0.GA.

I put hibernate-search, lucene-core, and hibernate-commons-annotations in the server/all/lib of my jboss server.

When I deploy my ear everything is ok (index directory is created). However when I try and persist to the database which will update the lucene index I get the following error:

Code:
javax.ejb.EJBException: java.lang.RuntimeException: java.lang.NoSuchMethodError: org.apache.lucene.document.Document.add(Lorg/apache/lucene/document/Field;)V
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
at $Proxy106.persist(Unknown Source)
at com.test.ejb.TestPersist.testPersist(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at junit.framework.TestCase.runTest(TestCase.java:154)


I am sure that one of my versions is incompatible. I have to stick with this version of hibernate so please do not tell me to update. Anyone run into this problem before?

Thanks


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Mon Dec 28, 2009 12:28 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello,
I've used your same versions quite often, I'm sure they play nicely together.
From the stacktrace I guess you're having a duplicate lucene.jar somewhere (in web application? in ear?). Check your classpath, there's some different Lucene version somewhere.
I'd suggest you to use Tattletale, it's a command-line tool that scans a JBoss directory for duplicate classes, it will save you some time and produce a reliable report.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Mon Dec 28, 2009 4:34 pm 
Beginner
Beginner

Joined: Mon Dec 21, 2009 3:43 pm
Posts: 24
The only thing that I can see is that I have mulitple versions of some hibernate stuff. But no duplicate versions of lucene anywhere, I only have lucene 2.3.0

It is coming from:
hibernate-search.jar 3.0.1.GA and hibernate-annotations.jar 3.2.1.GA

Does this mean I need a different version of hibernate-annotations than the one that came with jboss (3.2.1.GA). I don't think so but I cannot see any other issue

Code:
org.hibernate.search.Environment     hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.FullTextSession    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.Search    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.Boost    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.DateBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.DocumentId    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.Field    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.FieldBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.Index    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.Indexed    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.Resolution    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.annotations.Store    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.backend.Work    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.backend.WorkQueue    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.backend.Workspace    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.BridgeFactory    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.BridgeFactory$1    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.FieldBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.ParameterizedBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.String2FieldBridgeAdaptor    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.StringBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.TwoWayFieldBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.TwoWayString2FieldBridgeAdaptor    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.TwoWayStringBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.BigDecimalBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.BigIntegerBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.DateBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.DateBridge$1    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.DoubleBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.FloatBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.IntegerBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.LongBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.NumberBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.ShortBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.bridge.builtin.StringBridge    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.engine.DocumentBuilder    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.engine.DocumentBuilder$1    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.event.FullTextIndexEventListener    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.impl.FullTextSessionImpl    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.query.FullTextQueryImpl    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.query.IteratorImpl    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.query.ScrollableResultsImpl    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.store.DirectoryProvider    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.store.DirectoryProviderFactory    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.store.FSDirectoryProvider    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.store.RAMDirectoryProvider    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.BinderHelper    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.ContextHelper    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$1    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$Entry    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$EntryIterator    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$EntrySet    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$HashIterator    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$KeyIterator    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$KeySet    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$SimpleEntry    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$ValueIterator    hibernate-annotations.jar , hibernate-search.jar
org.hibernate.search.util.WeakIdentityHashMap$Values    hibernate-annotations.jar , hibernate-search.jar


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Mon Dec 28, 2009 5:34 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
You're right, annotations is the problem: the first Search edition was included in annotations 3.2.x, it was later splitted in annotations 3.3.x and hibernate-search 3.0.x
You should upgrade annotations from 3.2.x to 3.3.1;
Also This version of Search was compiled against Lucene 2.3.0 but some later bugfixes were included in Lucence, I'd suggest you to use 2.3.2

Sad that you can't upgrade hibernate-core, there are a lot of major improvements in Search 3.1.x.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Mon Dec 28, 2009 5:44 pm 
Beginner
Beginner

Joined: Mon Dec 21, 2009 3:43 pm
Posts: 24
Yeah cannot upgrade right now but it will happen in a few months :)

Can I use annotations 3.3.1 with sore 3.2.4.sp1, and all my other classes?

Thanks a ton!!!!


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Mon Dec 28, 2009 5:59 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Can I use annotations 3.3.1 with sore 3.2.4.sp1, and all my other classes?

yes that should work

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Mon Dec 28, 2009 8:57 pm 
Beginner
Beginner

Joined: Mon Dec 21, 2009 3:43 pm
Posts: 24
This is turning in a nightmare!

I changed to annotations 3.3.1.GA and I got and error which I think indicated that I needed hibernate-validator, So i added hibernate-validator to server/all/lib. Then I get the following error:

Code:
Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.AnnotationConfiguration.getReflectionManager()Lorg/hibernate/reflection/ReflectionManager;
   at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:156)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:869)
   at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:407)
   at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
   at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


What do I need now. I don't think that the following are compatible:
Hibernate core 3.2.4.sp1
Hibernate search 3.0.1.GA
Hibernate annotations 3.3.1.GA

What else do I need?
Hibernate validator 3.1.0?
new entity manager?
new core?

Also I cannot use class loader isolation because of a spring problem so I CANNOT upgrade hibernate core or entity manager to the newest versions. So how can I get hibernate search to work with jboss 4.2.3 with minimal changes?

I am not sure this is going to work? How do I get hibernate search working with jboss 4.2.3???

I.E. what version of search do I need to get search working without upgrading everything else for hibernate??? I thought that I could just throw in Search 3.0.1.GA and Lucene 2.3.0 into the server/all/lib directory and I would be good to go. What am I missing now???


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Tue Dec 29, 2009 7:27 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
look at the compatibility matrix: https://www.hibernate.org/6.html
It clearly states that for core 3.2 you need not use validator 3.1 but 3.0

You need the validator if you use it, this has nothing to do with Search (don't mix your problems ;-)

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Tue Dec 29, 2009 10:51 am 
Beginner
Beginner

Joined: Mon Dec 21, 2009 3:43 pm
Posts: 24
Seems like I need validator because without it I get:
Code:
Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/event/ValidateEventListener
   at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:68)
   at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:129)
   at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:125)
   at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)


You say that I should not need validator??? I am using event triggers to get my index updated. I think I need these triggers because my index does not update without them?

Looking at the matrix I needed all the following (including entity manager 3.3.1.GA)
Core 3.2.4.sp1
annotations 3.3.1.GA
Code:

search 3.0.1.GA
lucene 2.3.0
validator 3.0.0.GA
commons-annotations 3.0.0.GA
entity manager 3.3.1.GA



So with I all that can persist and store in the index but on persist I get this:
Code:
WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@93912f


Top
 Profile  
 
 Post subject: Re: Hibernate Search version problem using Jboss 4.2.3
PostPosted: Thu Jan 07, 2010 8:31 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi again,
sorry for the delay I've been way.
Quote:
You say that I should not need validator??? I am using event triggers to get my index updated. I think I need these triggers because my index does not update without them?
Validator doesn't have anything to do with triggers, I don't understand you sentence?

Quote:
So with I all that can persist and store in the index but on persist I get this:
Code:
WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@93912f

So it's working? nice. The arjuna log is a WARN, not an error, and I don't know if and how it has something to do with Search, you might have some error in transaction(s) configuration.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 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.