-->
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.  [ 3 posts ] 
Author Message
 Post subject: VerifyError: CacheableMultiReader overrides final method
PostPosted: Mon May 07, 2012 10:45 am 
Newbie

Joined: Tue Jun 01, 2010 4:18 am
Posts: 11
Hi all..

I'm newbie when talk about hibernate search. Before I post here, I'd google the stacktrace first, but found no result at all.

Because I'm newcomers on this area, I try the example described on hibernate search docs. My real application is using spring and spring JPA transaction manager, but I still get the error, then I just write unit test that described precisely on the docs. This is my unit test method:

Code:
    @Test
   public void simpleSearchTest() {
      final String keywords = "years";

      EntityManager entityManager = Persistence.createEntityManagerFactory("default").createEntityManager();
      entityManager.getTransaction().begin();
      FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);

      QueryBuilder qb = fullTextEntityManager.getSearchFactory().buildQueryBuilder().forEntity(Note.class).get();
      org.apache.lucene.search.Query query = qb.keyword().onFields("title").matching(keywords).createQuery();

      javax.persistence.Query persistenceQuery = fullTextEntityManager.createFullTextQuery(query, Note.class);

      @SuppressWarnings("unchecked")
      List<Note> result = persistenceQuery.getResultList();
      
      entityManager.getTransaction().commit();
      entityManager.close();
      
      Assert.assertNotNull(result);
   }


And this is my persistence.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence 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 persistence_2_0.xsd"
   version="2.0">
   
   <persistence-unit name="default">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      
        <class>org.xsalefter.notefinder.entity.Note</class>
       
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
         <property name="hibernate.show_sql" value="true" />
         <property name="hibernate.format_sql" value="false" />
         <property name="hibernate.hbm2ddl.auto" value="update" />
           
            <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/notefinder_test" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="admin" />
           
            <!-- Lucene -->
            <property name="hibernate.search.default.directory_provider"  value="filesystem" />
            <property name="hibernate.search.default.indexBase" value="G:/VarEtcTmpLog/lucene/index/notefinder" />
      </properties>
   </persistence-unit>
</persistence>


And here is the stacktrace:
Code:
java.lang.VerifyError: class org.hibernate.search.reader.impl.CacheableMultiReader overrides final method incRef.()V
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at org.hibernate.search.query.engine.impl.HSQueryImpl.buildSearcher(HSQueryImpl.java:596)
   at org.hibernate.search.query.engine.impl.HSQueryImpl.buildSearcher(HSQueryImpl.java:495)
   at org.hibernate.search.query.engine.impl.HSQueryImpl.queryEntityInfos(HSQueryImpl.java:239)
   at org.hibernate.search.query.hibernate.impl.FullTextQueryImpl.list(FullTextQueryImpl.java:209)
   at org.hibernate.search.jpa.impl.FullTextQueryImpl.getResultList(FullTextQueryImpl.java:147)
   at org.xsalefter.notefinder.test.SearchTest.simpleSearchTest(SearchTest.java:58)
   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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


I'm using JDK 6, Hibernate 4.1.0, Hibernate Search 4.1.0, and maven 3. Any suggestion about what I need to do for this?

Thanks,
xsalefter

PS: I want to put all maven dependency here, but this post is going too long already, and IMO most app dependency not relevant with the error (except for hibernate).


Top
 Profile  
 
 Post subject: Re: VerifyError: CacheableMultiReader overrides final method
PostPosted: Mon May 07, 2012 12:25 pm 
Newbie

Joined: Tue Jun 01, 2010 4:18 am
Posts: 11
Ok, silly me. This is only happen if I replace dafault lucene version (3.5) with lucene 3.6. Looks like I can't manually update lucene version with hibernate search.

Thanks,
xsalefter


Top
 Profile  
 
 Post subject: Re: VerifyError: CacheableMultiReader overrides final method
PostPosted: Mon May 07, 2012 6:08 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
indeed Lucene changed a bit, you can't use it with the latest release; if you don't mind you could checkout master from github and use that one: it was updated already.
I've also deployed some snapshots to Maven, use version 4.2.0-SNAPSHOT

_________________
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.  [ 3 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.