hazelcast icon indicating copy to clipboard operation
hazelcast copied to clipboard

NoSuchMethodError: org.hibernate.cfg.Configuration.addAnnotatedClass

Open romanr opened this issue 13 years ago • 3 comments

Getting these errors after adding this module:

Oops: NoSuchMethodError
An unexpected error occured caused by exception 
NoSuchMethodError: org.hibernate.cfg.Configuration.addAnnotatedClass(Ljava/lang/Class;)Lorg/hibernate/cfg/Configuration;

It looks like module is pulling in hibernate 3.5 while play 1.2.5 uses hibernate 3.6. Could that be a problem?

dependencies:

require:
    - play [1.2.5,)
    - play -> hazelcast 0.6
    - com.hazelcast -> hazelcast-hibernate 1.9.4.4

play deps --sync

~ play! 1.2.5, http://www.playframework.org
~ framework ID is developer
~
~ Resolving dependencies using /aplay/conf/dependencies.yml,
~
~   play->hazelcast 0.6 (from playContributedModules)
~   com.hazelcast->hazelcast-client 2.1 (from mavenCentral)
~   com.hazelcast->hazelcast 2.1 (from mavenCentral)
~   com.hazelcast->hazelcast-hibernate 1.9.4.4 (from mavenCentral)
~   org.hibernate->hibernate-core 3.5.0-Final (from mavenCentral)


~ Installing resolved dependencies,
~
~   modules/hazelcast-0.6
~   lib/hazelcast-hibernate-1.9.4.4.jar

~   lib/commons-pool-1.5.5.jar
~   lib/activemq-core-5.5.0.jar
~   lib/activemq-camel-5.5.0.jar
~   lib/camel-core-2.9.2.jar
~   lib/camel-context-2.9.2.jar
~   lib/camel-jms-2.9.2.jar
~   lib/camel-mail-2.9.2.jar
~   lib/camel-hazelcast-2.9.2.jar
~   lib/spring-tx-3.0.7.RELEASE.jar
~   lib/spring-beans-3.0.7.RELEASE.jar
~   lib/spring-aop-3.0.7.RELEASE.jar
~   lib/spring-expression-3.0.7.RELEASE.jar
~   lib/spring-asm-3.0.7.RELEASE.jar
~   lib/activation-1.1.jar
~   lib/hazelcast-client-2.1.jar
~   lib/hazelcast-2.1.jar
~   lib/hibernate-core-3.5.0-Final.jar

~ *****************************************************************************
~ WARNING: These dependencies are missing, your application may not work properly (use --verbose for details),
~
~   org.jboss.javaee->jboss-jacc-api_JDK4 1.1.0

romanr avatar Aug 14 '12 14:08 romanr

Changing to exclude hibernate helped so far:

    - com.hazelcast -> hazelcast-hibernate 1.9.4.4:
        exclude:
            - org.hibernate -> *

romanr avatar Aug 14 '12 17:08 romanr

i'll take your finding, test, and create a new release on modules repo. Thanks for the feedback :-)

marcuspocus avatar Aug 14 '12 18:08 marcuspocus

Thank you!

I have three issues, could you please let me know if all this a configuration issue or something else:

I tried searching for this but couldn't find a solution. When I start it with default multicast configuration I get SEVERE error two times before it appears to settle in.

INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 [dev] Copyright (C) 2008-2012 Hazelcast.com
Aug 15, 2012 3:35:29 AM com.hazelcast.impl.Node
SEVERE: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 [dev] Can't assign requested address
java.net.SocketException: Can't assign requested address
    at java.net.PlainDatagramSocketImpl.join(Native Method)
    at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:181)
    at java.net.MulticastSocket.joinGroup(MulticastSocket.java:307)
    at com.hazelcast.impl.Node.<init>(Node.java:208)
    at com.hazelcast.impl.FactoryImpl.<init>(FactoryImpl.java:376)
    at com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(FactoryImpl.java:124)
    at com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(FactoryImpl.java:110)
    at com.hazelcast.core.Hazelcast.getDefaultInstance(Hazelcast.java:81)
    at com.hazelcast.hibernate.HazelcastInstanceLoader.loadInstance(HazelcastInstanceLoader.java:67)
    at com.hazelcast.hibernate.HazelcastInstanceFactory.createInstance(HazelcastInstanceFactory.java:56)
    at com.hazelcast.hibernate.HazelcastCacheRegionFactory.start(HazelcastCacheRegionFactory.java:96)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:238)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
    at play.db.jpa.JPAPlugin.onApplicationStart(JPAPlugin.java:267)
    at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:525)
    at play.Play.start(Play.java:526)
    at play.Play.detectChanges(Play.java:630)
    at play.Invoker$Invocation.init(Invoker.java:198)
    at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:189)
    at play.Invoker$Invocation.run(Invoker.java:276)
    at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:229)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
Aug 15, 2012 3:35:29 AM com.hazelcast.impl.LifecycleServiceImpl
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 [dev] Address[fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 is STARTING
Aug 15, 2012 3:35:29 AM com.hazelcast.impl.Node
WARNING: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 [dev] No join method is enabled! Starting standalone.
Aug 15, 2012 3:35:29 AM com.hazelcast.impl.LifecycleServiceImpl
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 [dev] Address[fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 is STARTED
Aug 15, 2012 3:35:29 AM com.hazelcast.impl.management.ManagementCenterService
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 [dev] Hazelcast Management Center is listening from http://localhost:8081/
Aug 15, 2012 3:35:29 AM com.hazelcast.impl.PartitionManager
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6701 [dev] Initializing cluster partition table first arrangement...
[INFO]    [8/15/12 3:35 AM] [play-thread-1] [CamelContextManager.] Camel context initialized
[INFO]    [8/15/12 3:35 AM] [play-thread-1] [CamelContextManager.] Camel context started
Aug 15, 2012 3:35:31 AM com.hazelcast.config.XmlConfigBuilder
INFO: Looking for hazelcast.xml config file in classpath.
Aug 15, 2012 3:35:31 AM com.hazelcast.config.XmlConfigBuilder
INFO: Using configuration file /Users/roman/Projects/hitask-play/conf/hazelcast.xml in the classpath.
Aug 15, 2012 3:35:31 AM com.hazelcast.system
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Hazelcast Community Edition 2.1 (20120502) starting at Address[fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702
Aug 15, 2012 3:35:31 AM com.hazelcast.system
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Copyright (C) 2008-2012 Hazelcast.com
Aug 15, 2012 3:35:31 AM com.hazelcast.impl.Node
SEVERE: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Can't assign requested address
java.net.SocketException: Can't assign requested address
    at java.net.PlainDatagramSocketImpl.join(Native Method)
    at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:181)
    at java.net.MulticastSocket.joinGroup(MulticastSocket.java:307)
    at com.hazelcast.impl.Node.<init>(Node.java:208)
    at com.hazelcast.impl.FactoryImpl.<init>(FactoryImpl.java:376)
    at com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(FactoryImpl.java:124)
    at com.hazelcast.impl.FactoryImpl.newHazelcastInstanceProxy(FactoryImpl.java:110)
    at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:396)
    at play.modules.hazelcast.HazelcastPlugin.onApplicationStart(HazelcastPlugin.java:65)
    at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:525)
    at play.Play.start(Play.java:526)
    at play.Play.detectChanges(Play.java:630)
    at play.Invoker$Invocation.init(Invoker.java:198)
    at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:189)
    at play.Invoker$Invocation.run(Invoker.java:276)
    at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:229)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
Aug 15, 2012 3:35:31 AM com.hazelcast.impl.LifecycleServiceImpl
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Address[fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 is STARTING
Aug 15, 2012 3:35:31 AM com.hazelcast.impl.Node
WARNING: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] No join method is enabled! Starting standalone.
Aug 15, 2012 3:35:31 AM com.hazelcast.impl.Node
WARNING: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Config seed port is 6701 and cluster size is 1. Some of the ports seem occupied!
Aug 15, 2012 3:35:31 AM com.hazelcast.impl.LifecycleServiceImpl
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Address[fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 is STARTED
Aug 15, 2012 3:35:31 AM com.hazelcast.impl.management.ManagementCenterService
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Hazelcast Management Center is listening from http://localhost:8081/
Aug 15, 2012 3:35:31 AM com.hazelcast.impl.PartitionManager
INFO: [fd36:7714:7151:fc58:b9ce:9ed2:cc0:a18e]:6702 [dev] Initializing cluster partition table first arrangement...

And when it's started not as multicast but as tcp-ip enabled="true" I get different kind of weird:

INFO: [127.0.0.1]:6702 [dev] Could not connect to: /127.0.0.1:6703. Reason: ConnectException[Connection refused]
Aug 15, 2012 4:12:33 AM com.hazelcast.cluster.ClusterManager
INFO: [127.0.0.1]:6701 [dev] 

Members [2] {
    Member [127.0.0.1]:6701 this
    Member [127.0.0.1]:6702
}

First it gives "connection refused". then it's same server listed two times on different ports! Is that normal or it's caused by hazelcast being embedded into Play?

No matter how I configure it, the Management center never appears to be working

INFO: [127.0.0.1]:6702 [dev] Hazelcast Management Center is listening from http://localhost:8081/

There's nothing on that port. Tried different ports and paths, addresses.

Thanks!

romanr avatar Aug 14 '12 18:08 romanr