-->
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.  [ 7 posts ] 
Author Message
 Post subject: ConfigContext Issue Upgrading to hibernate-search-3.3.0
PostPosted: Thu Apr 07, 2011 12:14 pm 
Newbie

Joined: Wed Oct 06, 2010 10:53 am
Posts: 3
Location: Toronto, ON
I'm trying to upgrade a Seam Framework project to hibernate-search-3.3.0.Final from 3.1 after encountering bug HSEARCH-610. I've also upgraded to all the .jar files found in the /hibernate-search-3.3.0.Final/dist/lib/required/ directory of the distribution. I've verified all the correct .jar files are added in the project's .classpath. However, the following exception is thrown on the JBoss server startup:

Code:
11:52:06,747 ERROR [AbstractKernelController]  Error installing to Start: name=persistence.unit:unitName=#MGI state=Create
java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.search.impl.ConfigContext
   at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:348)
   at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:262)
   at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:144)
   at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:137)
   at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
   at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
   at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
   at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1338)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
   at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
   at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
   at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
   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.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
   at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
   at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
   at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
   at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
   at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
   at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
   at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
   at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
   at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
   at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
   at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
   at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
   at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
   at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
   at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
   at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
   at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
   at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
   at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
   at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
   at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
   at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
   at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
   at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
   at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
   at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
   at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
   at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
   at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
   at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
   at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
   at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
   at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
   at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
   at org.jboss.Main.boot(Main.java:221)
   at org.jboss.Main$1.run(Main.java:556)
   at java.lang.Thread.run(Thread.java:662)


This is the relevant section in persistence.xml:

Code:
<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 http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">

   <persistence-unit name="MGI" transaction-type="JTA">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>MGIDatasource</jta-data-source>
      <properties>
         <property name="jboss.entity.manager.factory.jndi.name" value="java:/EntityManagerFactories/MGIEntityManager"/>
         <property name="hibernate.dialect" value="org.hibernate.dialect.SybaseDialect" />
         <property name="hibernate.default_batch_fetch_size" value="1" />
         <property name="hibernate.jdbc.batch_size" value="1"/>
         <property name="hibernate.use_sql_comments" value="true" />
         <property name="hibernate.show_sql" value="true" />
         <property name="hibernate.format_sql" value="false" />
         <!--
            Only relevant if Seam is loading the persistence unit (Java SE
            bootstrap)
         -->
         <property name="hibernate.transaction.manager_lookup_class"
                   value="@transactionManagerLookupClass@" />
         <property name="hibernate.search.default.directory_provider"
                   value="org.hibernate.search.store.FSDirectoryProvider" />
         <!-- Directory where entity indices will be stored. -->
         <property name="hibernate.search.default.indexBase"
                   value="/usr/local/jboss/server/default/data/indexes" />
      </properties>

   </persistence-unit>

</persistence>


It seems the constructor of ConfigContext is throwing an exception (likely in relation to lucene-core? I've tried 2.9.2, 3.0.3 [in the distrib], & 3.1) but setting a breakpoint in the constructor and restarting the server in debug mode doesn't enable the debug view in Eclipse once the constructor is reached on startup. Googling the exact phrase "java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.search.impl.ConfigContext" doesn't provide a single result so I'm at a loss as to how to fix this problem.


Top
 Profile  
 
 Post subject: Re: ConfigContext Issue Upgrading to hibernate-search-3.3.0
PostPosted: Thu Apr 07, 2011 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
I've verified all the correct .jar files are added in the project's .classpath. However, the following exception is thrown on the JBoss server startup:

by ".classpath" you mean in Eclipse? that's not the same as what JBoss will see when it starts.
Do you have some unit tests you can run in Eclipse to verify it's all fine?

Quote:
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory( "MGI" );
EntityManager entityManager = entityManagerFactory.createEntityManager();
FullTextEntityManager ftEntityManager = Search.getFullTextEntityManager( entityManager );

(You'll have to adapt your persistence.xml a bit so that it can run outside of the container )

From the error message I guess you're right, you're likely missing a Lucene upgrade. Make sure you replaced all Lucene jars with the correct one.
To make *really sure* you can have Tattletale (a command line utility you can download here) scan your directories to see if it finds duplicate classes, or jars of a version different than expected.

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


Top
 Profile  
 
 Post subject: Re: ConfigContext Issue Upgrading to hibernate-search-3.3.0
PostPosted: Thu Apr 07, 2011 2:06 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
BTW this is the wrong forum; Search has it's own subforum.

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


Top
 Profile  
 
 Post subject: Re: ConfigContext Issue Upgrading to hibernate-search-3.3.0
PostPosted: Fri Apr 08, 2011 11:35 am 
Newbie

Joined: Wed Oct 06, 2010 10:53 am
Posts: 3
Location: Toronto, ON
The problem was the newer .jar hibernate-search-analyzers (which contains classes formerly in hibernate-search) wasn't in the deployed-jars.list file used by JBoss to deploy projects during the build process. The class StandardAnalyzer couldn't be found when referenced by one of the methods called in the ConfigContext constructor.

However I'm still having issues with a versioning mismatch in my libraries. I've upgraded hibernate-search and then worked off the .jar versions found in /dist/lib/required/ directory of its archive. These are the files I've changed to:

Code:
hibernate-search-3.3.0.Final.jar
   antlr-2.7.6.jar
   commons-collections-3.1.jar
   dom4j-1.6.1.jar
   hibernate-commons-annotations-3.2.0.Final.jar
   hibernate-core-3.6.0.Final.jar
      hibernate-annotations-3.5.6-Final.jar
      hibernate-entitymanager-3.6.0.Final.jar
      hibernate-validator-3.1.0.GA.jar
   hibernate-search-analyzers-3.3.0.Final.jar
   jta-1.1.jar
   lucene-core-3.0.3.jar
      lucene-highlighter-3.0.3.jar
      lucene-memory-3.0.3.jar
      lucene-queries-3.0.3.jar
   slf4j-api-1.6.1.jar
      slf4j-log4j12-1.6.1.jar


I'm now getting the exception:

Code:
ERROR [AbstractKernelController]  Error installing to Start: name=persistence.unit:unitName=#lims state=Create
java.lang.NoClassDefFoundError: org/hibernate/util/LRUMap
   at org.hibernate.search.util.SoftLimitMRUCache.init(SoftLimitMRUCache.java:203)


Is it possible for you to move this thread to the proper subform? Thanks.


Top
 Profile  
 
 Post subject: Re: ConfigContext Issue Upgrading to hibernate-search-3.3.0
PostPosted: Fri Apr 08, 2011 12:22 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
you should remove hibernate-annotations-3.5.6-Final.jar, the classes where merged in hibernate-core. (Tattletale should have you told that!)

The error you've shown comes from an incompatible hibernate jar on the classpath. maybe it's the hibernate-annotations-3.5.6-Final.jar itself, or it's loading the older hibernate from JBoss (I believe it's a different version? please check): you should isolate the classloader in that case to make sure your app gets the correct classes.

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


Top
 Profile  
 
 Post subject: Re: ConfigContext Issue Upgrading to hibernate-search-3.3.0
PostPosted: Fri Apr 08, 2011 4:53 pm 
Newbie

Joined: Wed Oct 06, 2010 10:53 am
Posts: 3
Location: Toronto, ON
s.grinovero wrote:
The error you've shown comes from an incompatible hibernate jar on the classpath. maybe it's the hibernate-annotations-3.5.6-Final.jar itself, or it's loading the older hibernate from JBoss

The latter was exactly the case. I misunderstood the deployment process and it ends up the only Hibernate files being deployed from my project's /lib directory were hibernate-commons-annotations.jar and hibernate-search.jar. All the other older versions (including hibernate-core.jar dating back to May 2009) were in ~/jboss-5.1.0.GA/common/lib/. Since the JBoss Server and Hibernate versions are tightly bound, we'd have to upgrade to JBoss Server 6 and Seam 3 which isn't a very stable environment at the moment.

So instead I applied the patch to org.hibernate.search.filter.AndDocIdSet.java (the only file affected by the fix in HSEARCH-610) into the hibernate-search-3.1.1.GA.jar. I already see that it fixes our problem with disappearing search results when certain @FullTextFilterDefs are applied to entity lookups.

Cheers for your quick replies.


Top
 Profile  
 
 Post subject: Re: ConfigContext Issue Upgrading to hibernate-search-3.3.0
PostPosted: Fri Apr 08, 2011 7:37 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
I'm glad that fixed your issue, but you don't need to stay stuck on an older version of Hibernate core and/or Hibernate Search.
You can deploy a different Hibernate version with your application. When an EAR is properly packaged you can make sure it will use only the hibernate version with your application.

Just to make sure you know your options. BTW JBoss6 doesn't force you to move to Seam3 either, 2 will work.

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