Re: [Neo4j] Problem connecting embedded Database with running HA Cluster in 1.9RC2

158 views
Skip to first unread message

Peter Neubauer

unread,
May 15, 2013, 9:52:22 PM5/15/13
to Neo4j User
Hi there,
there seem to be classes missing in your setup. How are you pulling in
the libraries? Got the project somewhere?

/peter

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

The authoritative book on graph databases - http://graphdatabases.com
Neo4j questions? Please use SO - http://stackoverflow.com/search?q=neo4j


On Wed, May 15, 2013 at 2:16 PM, joewhite86 <joche...@gmail.com> wrote:
> Hi,
>
> I'm trying to connect a Java embedded database with a running cluster. I've
> successfully started two standalone clusters with the configuration from
> http://docs.neo4j.org/chunked/1.9.RC2/ha-setup-tutorial.html.
>
> Environment: JDK 1.7, Neo4j Standalone 1.9RC2, 1.9M03 Java Libraries
>
> In both running clusters I get a NullPointerException when the embedded node
> tries to connect in console.log:
>
> 15.05.13 22:57:31 org.neo4j.server.AbstractNeoServer INFO: Server started on
> [http://localhost:7474/]
> java.lang.NullPointerException
> at
> org.neo4j.cluster.protocol.cluster.ClusterState$4.handle(ClusterState.java:430)
> at
> org.neo4j.cluster.protocol.cluster.ClusterState$4.handle(ClusterState.java:405)
> at org.neo4j.cluster.statemachine.StateMachine.handle(StateMachine.java:84)
> at org.neo4j.cluster.StateMachines$1.run(StateMachines.java:135)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>
> The embedded node connects without throwing an error, but hasn't the test
> node in store I created on the running nodes.
>
> When I have only one instance started, I get following output when I start
> the embedded node: (with the same NullPointerException in standalone
> console.log)
>
> 2013-05-15 21:07:11.482+0000 ERROR [o.n.c.c.NetworkInstance]: Receive
> exception:
> java.io.InvalidClassException: failed to read class descriptor
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
> ~[na:1.7.0_21]
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
> ~[na:1.7.0_21]
> at
> org.jboss.netty.handler.codec.serialization.ObjectDecoder.decode(ObjectDecoder.java:127)
> ~[netty-3.5.7.Final.jar:na]
> at
> org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:422)
> ~[netty-3.5.7.Final.jar:na]
> at
> org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
> ~[netty-3.5.7.Final.jar:na]
> at
> org.jboss.netty.handler.logging.LoggingHandler.handleUpstream(LoggingHandler.java:333)
> ~[netty-3.5.7.Final.jar:na]
> at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
> ~[netty-3.5.7.Final.jar:na]
> at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
> ~[netty-3.5.7.Final.jar:na]
> at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:84)
> ~[netty-3.5.7.Final.jar:na]
> at
> org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:465)
> ~[netty-3.5.7.Final.jar:na]
> at
> org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:332)
> ~[netty-3.5.7.Final.jar:na]
> at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
> ~[netty-3.5.7.Final.jar:na]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [na:1.7.0_21]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [na:1.7.0_21]
> at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21]
> Caused by: java.lang.ClassNotFoundException:
> org.neo4j.cluster.protocol.cluster.ClusterMessage$ConfigurationRequestState
> at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_21]
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_21]
> at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_21]
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_21]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:423) ~[na:1.7.0_21]
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> ~[na:1.7.0_21]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ~[na:1.7.0_21]
> at java.lang.Class.forName0(Native Method) ~[na:1.7.0_21]
> at java.lang.Class.forName(Class.java:266) ~[na:1.7.0_21]
> at
> org.jboss.netty.handler.codec.serialization.ClassLoaderClassResolver.resolve(ClassLoaderClassResolver.java:30)
> ~[netty-3.5.7.Final.jar:na]
> at
> org.jboss.netty.handler.codec.serialization.CachingClassResolver.resolve(CachingClassResolver.java:39)
> ~[netty-3.5.7.Final.jar:na]
> at
> org.jboss.netty.handler.codec.serialization.CompactObjectInputStream.readClassDescriptor(CompactObjectInputStream.java:58)
> ~[netty-3.5.7.Final.jar:na]
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)
> ~[na:1.7.0_21]
> ... 21 common frames omitted
>
>
>
> Configs for standalone instances:
>
> ha.server_id=1
> ha.initial_hosts=:5001,:5002,:5003
> ha.server=:6001
> ha.cluster_server=:5001
> org.neo4j.server.database.mode=HA
> org.neo4j.server.webserver.port=7474
> org.neo4j.server.webserver.https.port=7473
>
> ha.server_id=2
> ha.initial_hosts=:5001,:5002,:5003
> ha.server=:6002
> ha.cluster_server=:5002
> org.neo4j.server.database.mode=HA
> org.neo4j.server.webserver.port=7575
> org.neo4j.server.webserver.https.port=7574
>
> Embedded Code:
>
> HashMap<String, String> haConfig = new HashMap<String, String>();
>
> haConfig.put("ha.server_id", "3");
> haConfig.put("ha.initial_hosts", ":5001,:5002,:5003");
> haConfig.put("ha.server", ":6003");
> haConfig.put("ha.cluster_server", ":5003");
> haConfig.put("org.neo4j.server.database.mode", "HA");
>
> final GraphDatabaseService graphDb = new
> HighlyAvailableGraphDatabaseFactory()
> .newHighlyAvailableDatabaseBuilder("test.db")
> .setConfig(haConfig)
> .newGraphDatabase();
>
> Runtime.getRuntime().addShutdownHook(new Thread() {
> @Override
> public void run() {
> graphDb.shutdown();
> }
> });
>
> System.out.println("Database set up");
>
>
> Any ideas?
>
> Thanks in advise.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to neo4j+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Chris Gioran

unread,
May 16, 2013, 5:06:17 AM5/16/13
to ne...@googlegroups.com
Hi,

am i correct in understanding that you are trying to mix Neo4j versions? If that's the case, this won't work - i did try the version mix you describe and i get the same results. Lots of things have changed between M02 and RC2 and those kinds of failures are expected. If you try out creating your cluster with RC2 across all instances it should work fine.

thank you,
CG

joewhite86

unread,
May 16, 2013, 9:45:18 AM5/16/13
to ne...@googlegroups.com
Thanks! Using the correct version did the trick for me.

Strange that IntelliJ accepted the RC2 version only after i set it in .pom file and did a 'mvn dependency:list'...
Reply all
Reply to author
Forward
0 new messages