-->
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.  [ 4 posts ] 
Author Message
 Post subject: NoSuchMethodError with FullTextSession.createFullTextQuery
PostPosted: Mon Apr 07, 2008 7:09 am 
Newbie

Joined: Wed Apr 02, 2008 5:22 am
Posts: 6
Hi,

I'm using Hibernate Search 3.0.1.GA with JBoss AS 4.2.2.GA, using JPA. When I try and perform a search with the following code:

Code:
FullTextEntityManager fullTextEm = Search.createFullTextEntityManager(em);       
org.apache.lucene.search.Query luceneQuery = builder.buildQuery();
FullTextQuery query = fullTextEm.createFullTextQuery(luceneQuery, entityClass);


I get the following error:

Quote:
Caused by: java.lang.NoSuchMethodError: org.hibernate.search.FullTextSession.createFullTextQuery(Lorg/apache/lucene/search/Query;[Ljava/lang/Class;)Lo
rg/hibernate/search/FullTextQuery;
at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.createFullTextQuery(FullTextEntityManagerImpl.java:61)
at com.vocado.services.search.SearchServiceBean.buildQuery(SearchServiceBean.java:60)
at com.vocado.services.search.SearchServiceBean.projectionSearch(SearchServiceBean.java:41)
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:585)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)


I am including hibernate-search.jar and lucene-core.jar in my ear (and application.xml), and the hibernate3.jar, hibernate-entitymanager.jar, hibernate-annotations.jar, hibernate-commons-annotations.jar are in the Jboss server/default/lib directory.

I've tried a number of combinations of the dependencies (and putting them in the EAR or lib), but can't seem to find anything that works.

Any help much appreciated.

Many thanks,

Anton


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 6:43 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
somehow you forgot to replace the hibernate-annotations/hibernate-commoins-annotations from server/default/lib

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 7:00 am 
Newbie

Joined: Wed Apr 02, 2008 5:22 am
Posts: 6
Thanks for your help. I'm managed to get it working.

In case anyone else has this problem, the way I managed to solve it was with the following setup (and versions):
--------------
In server/default/lib:
hibernate-3.2.6.ga
hibernate-commons-annotations-3.0.0.ga.jar
hibernate-annotations-3.3.1.GA.jar
hibernate-entitymanager-3.3.2.GA.jar
--------------
In EAR (and application.xml):
hibernate-search-3.0.1.GA.jar
lucene-core-2.3.1.jar
--------------

Cheers,

Anton


Top
 Profile  
 
 Post subject: NoSuchMethodError with FullTextSession.createFullTextQuery
PostPosted: Fri Sep 19, 2008 11:09 am 
Newbie

Joined: Fri Sep 19, 2008 10:26 am
Posts: 8
Hi,
I have the same problem but I couldn't resolve it using the libraries you posted.

Actually I tried all possible jars combinations:

--------------------------------------------------------
In server/default/lib:
hibernate-3.2.6/3.3.1
hibernate-annotations-3.3.1/3.4.0
hibernate-entitymanager-3.3.0/3.3.1/3.3.2/3.4.0
hibernate-validator-3.0.0/3.1.0
hibernate-commons-annotations-3.0.0

---------------------------------------------------------
In WEB-INF/lib:
lucene-core-2.30/2.3.1/2.3.2
hibernate-search-3.0.1/3.1.0

---------------------------------------------------------

I also tried the new hibernate-search beta release but still the same problem.

this is the full exception:
Code:
java.lang.NoSuchMethodError: org.hibernate.search.FullTextSession.createFullTextQuery(Lorg/apache/lucene/search/Query;[Ljava/lang/Class;)Lorg/hibernate/Query;
   at it.ror.search.Searcher.getSearch(Searcher.java:55)
   at it.rortutor.servlet.ServletLuceneTest.processRequest(ServletLuceneTest.java:43)
   at it.rortutor.servlet.ServletLuceneTest.doGet(ServletLuceneTest.java:72)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
   at java.lang.Thread.run(Unknown Source)


I guess there is some other dependecy I am forgetting.

I have no problems indexing my data.
Problems only comes when I try to perform a search with the following code :

Code:
AnnotationConfiguration h8Conf= new AnnotationConfiguration();
      h8Conf.configure();
h8Conf.getProperties().put(org.hibernate.search.Environment.ANALYZER_CLASS, StandardAnalyzer.class.getName());
      SessionFactory sessionFactory=h8Conf.buildSessionFactory();
      Session s= sessionFactory.openSession();
      FullTextSession fullTextSession= Search.createFullTextSession(s);
      Transaction tx=fullTextSession.beginTransaction();
MultiFieldQueryParser parser = new MultiFieldQueryParser(new String[]{"idParagrafo.nome", "testo"},
            new StandardAnalyzer());
      org.apache.lucene.search.Query q=parser.parse(param);
      Query h8Query=fullTextSession.createFullTextQuery(q, Contenuti.class);


Please can you list all the jars you have in your JBOSS_HOME/server/default/lib and in your WEB-INF/lib?

Thank you so much for any help

Violix


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