Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Hibernate Search 5.5.6 - Java 7 - Having Issues - Need Help!
PostPosted: Thu Jan 12, 2017 6:47 pm 
Beginner
Beginner

Joined: Sun Aug 16, 2015 3:21 am
Posts: 27
Hi,

I tried to run 5.5.6 on Java 7 as can't upgrade to Java 8 for the moment. I am sending list (at the end) of all jars I am using.

The issue I am facing is this (below stacktrace): I know it seems quite fundamental to fix, but I am seriously getting frustrated as all jars I downloaded as per specs.

Is it because InfinispanDirectoryProvider is not getting loaded in Java 7 at runtime? BECAUSE it is compiled in Java 8.0 (I saw from its MANIFEST Build-Jdk: 1.8.0_60).

I did re-compile infinsispan directory provider using JDK 7 (I have) but then I got a different issue NoClassDefFoundError (InfinispanDirectoryProvider), Might be this time hibernate search denied as it was expecting Java 1.8 compiled of directory provider. I know this is silly to try but I did.

I can see hibernate-search-engine jar is compiled at Java (Build-Jdk: 1.8.0_112), but in stacktrace I can see classes are loaded and getting used properly.

Caused by: java.lang.UnsupportedClassVersionError: org/infinispan/hibernate/search/spi/InfinispanDirectoryProvider : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.hibernate.search.util.impl.AggregatedClassLoader.findClass(AggregatedClassLoader.java:70)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.search.engine.service.classloading.impl.DefaultClassLoaderService.classForName(DefaultClassLoaderService.java:61)
at org.hibernate.search.cfg.impl.DelegatingClassLoaderService.classForName(DelegatingClassLoaderService.java:48)
at org.hibernate.search.util.impl.ClassLoaderHelper.classForName(ClassLoaderHelper.java:274)
at org.hibernate.search.util.impl.ClassLoaderHelper.instanceFromName(ClassLoaderHelper.java:57)
at org.hibernate.search.store.spi.BaseDirectoryProviderService.initialize(BaseDirectoryProviderService.java:57)
at org.hibernate.search.store.spi.BaseDirectoryProviderService.create(BaseDirectoryProviderService.java:52)
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.createDirectoryProvider(DirectoryBasedIndexManager.java:230)
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:90)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:256)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482)
at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91)
at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:358)
at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:199)
at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:117)
at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:75)
at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:532)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:50)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:268)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)


hibernate-search-backend-jgroups-5.5.6.Final.jar
hibernate-search-backend-jms-5.5.6.Final.jar
hibernate-search-engine-5.5.6.Final.jar
hibernate-search-infinispan-5.5.5.Final.jar
hibernate-search-orm-5.5.6.Final.jar
infinispan-cachestore-jdbc-8.1.0.Final.jar
infinispan-commons-8.1.0.Final.jar
infinispan-core-8.1.0.Final.jar
infinispan-directory-provider-8.1.0.Final.jar
infinispan-lucene-directory-8.1.0.Final.jar
jboss-annotations-api_1.2_spec-1.0.0.Final.jar
jboss-jms-api_2.0_spec-1.0.0.Final.jar
jboss-marshalling-osgi-1.4.10.Final.jar
jboss-transaction-api_1.2_spec-1.0.0.Final.jar
jgroups-3.6.10.Final.jar
lucene-analyzers-common-5.3.1.jar
lucene-core-5.3.1.jar
lucene-facet-4.10.4.jar
lucene-queryparser-4.10.4.jar

antlr-2.7.7.jar
cglib-2.2.jar
commons-collections-3.2.1.jar
dom4j-1.6.1.jar
hibernate-commons-annotations-5.0.1.Final.jar
hibernate-core-5.0.11.Final.jar
jandex-1.1.0.Final.jar
javassist-3.18.1-GA.jar
jboss-logging-3.3.0.Final.jar
jboss-logging-annotations-1.2.0.Beta1.jar
jta-1.1.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
hibernate-entitymanager-5.0.11.Final.jar
hibernate-jpa-2.1-api-1.0.0.Final.jar
hibernate-validator-4.1.0.Final.jar
validation-api-1.0.0.GA.jar


Top
 Profile  
 
 Post subject: Re: Hibernate Search 5.5.6 - Java 7 - Having Issues - Need Help!
PostPosted: Sat Jan 14, 2017 6:56 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello,

Hibernate Search itself is compatible with Java 7, at least until version 5.6.x. Infinispan though requires Java 8, so if you want to use the Infinispan Directory that won't work on Java 7.

N.B. Hibernate Search will also require Java 8 since version 5.7, so you might have one more reason to upgrade.

HTH

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


Last edited by sanne.grinovero on Mon Jan 16, 2017 11:05 am, edited 1 time in total.
Corrected the versions!


Top
 Profile  
 
 Post subject: Re: Hibernate Search 5.5.6 - Java 7 - Having Issues - Need Help!
PostPosted: Mon Jan 16, 2017 5:58 am 
Beginner
Beginner

Joined: Sun Aug 16, 2015 3:21 am
Posts: 27
Quote:
Hibernate Search itself is compatible with Java 7, at least until version 5.5.x. Infinispan though requires Java 8, so if you want to use the Infinispan Directory that won't work on Java 7.

I realised that for Java 7 we can use Maximum 5.4.0 for all modules to work including Infinispan (That would be 7_2_0).

Quote:
N.B. Hibernate Search will also require Java 8 since version 5.6, so you might have one more reason to upgrade.

I tried 5.6.CR1.jar with elastic search and all worked on Java 7. Are you saying final release of Hibernate Search 5.6.0 won't work on Java 7??? I am talking here without Infinispan. I am using Hibernate Search (5.6.CR1.jar), with Hibernate (5.1.3) and JPA (2.1)


Top
 Profile  
 
 Post subject: Re: Hibernate Search 5.5.6 - Java 7 - Having Issues - Need Help!
PostPosted: Mon Jan 16, 2017 11:04 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Sorry, I had a critical typo in my previous answer.

It should not have been:
Quote:
N.B. Hibernate Search will also require Java 8 since version 5.6, so you might have one more reason to upgrade.

but the correct statement:
Quote:
N.B. Hibernate Search will also require Java 8 since version 5.7, so you might have one more reason to upgrade.


Quote:
I tried 5.6.CR1.jar with elastic search and all worked on Java 7. Are you saying final release of Hibernate Search 5.6.0 won't work on Java 7??? I am talking here without Infinispan. I am using Hibernate Search (5.6.CR1.jar), with Hibernate (5.1.3) and JPA (2.1)


Those will work on Java 7, my bad. Hope it's clear now.

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


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