Elad Tabak
Elad Tabak

Reputation: 2417

Upgrading to Spring 5.0.0.RELEASE - failed to instantiate hazelcast

I'm upgrading from Spring 4.3.x to 5.0.0. After fixing some references to hibernate5 related classes, I'm getting the following error:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.ExceptionInInitializerError
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:186)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:575)
    ... 100 common frames omitted
Caused by: java.lang.ExceptionInInitializerError: null
    at com.hazelcast.hibernate.serialization.Hibernate4CacheEntrySerializerHook.createSerializer(Hibernate4CacheEntrySerializerHook.java:59)
    at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.registerSerializerHooks(DefaultSerializationServiceBuilder.java:286)
    at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.build(DefaultSerializationServiceBuilder.java:220)
    at com.hazelcast.instance.DefaultNodeExtension.createSerializationService(DefaultNodeExtension.java:125)
    at com.hazelcast.instance.Node.<init>(Node.java:174)
    at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:125)
    at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:160)
    at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:143)
    at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:111)
    at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:58)

....

Caused by: java.lang.NoSuchMethodException: org.hibernate.cache.spi.entry.StandardCacheEntryImpl.<init>([Ljava.io.Serializable;, java.lang.String, boolean, java.lang.Object)
        at java.lang.Class.getConstructor0(Class.java:3082)
        at java.lang.Class.getDeclaredConstructor(Class.java:2178)
        at com.hazelcast.hibernate.serialization.Hibernate42CacheEntrySerializer.<clinit>(Hibernate42CacheEntrySerializer.java:47)

Anyone encountered the issue? does hazelcast supports spring 5.0.0? I didn't find and documentation about it.

Upvotes: 1

Views: 929

Answers (1)

noctarius
noctarius

Reputation: 6094

Because of certain internal changes in Hibernate you need another version of the integration. See the correct integration here: https://github.com/hazelcast/hazelcast-hibernate5

Upvotes: 2

Related Questions