graphaware / neo4j-framework

GraphAware Neo4j Framework
244 stars 68 forks source link

Neo4j (2.3.1) fails to start with runtime (2.3.1.36) enabled #40

Closed drew-moore closed 8 years ago

drew-moore commented 8 years ago

I'm developing a server extension, with a fresh install of neo4j 2.3.1 and graphaware-embedded-all-2.3.1.36.jar in the plugins directory. Neo4 fails to start when I have runtime enabled, barfing on:

2015-12-30 06:02:35.693-0800 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@59038530' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@59038530' was successfully initialized, but failed to start. Please see attached cause exception. org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@59038530' was successfully initialized, but failed to start. Please see attached cause exception.
    at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:67)
    at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:234)
    at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:97)
    at org.neo4j.server.CommunityBootstrapper.start(CommunityBootstrapper.java:48)
    at org.neo4j.server.enterprise.EnterpriseBootstrapper.main(EnterpriseBootstrapper.java:32)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@569970e' was successfully initialized, but failed to start. Please see attached cause exception.
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
    at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:194)
    ... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.enterprise.EnterpriseFacadeFactory, /home/drew/neo/data/my.empty.db
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
    at org.neo4j.kernel.impl.enterprise.EnterpriseFacadeFactory.newFacade(EnterpriseFacadeFactory.java:40)
    at org.neo4j.graphdb.EnterpriseGraphDatabase.<init>(EnterpriseGraphDatabase.java:57)
    at org.neo4j.server.enterprise.EnterpriseNeoServer$2.newGraphDatabase(EnterpriseNeoServer.java:67)
    at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:95)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
    ... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'com.graphaware.runtime.bootstrap.RuntimeKernelExtension@6cd917cd' was successfully initialized, but failed to start. Please see attached cause exception.
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
    at org.neo4j.kernel.extension.KernelExtensions.start(KernelExtensions.java:86)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
    ... 10 more
Caused by: java.lang.NoSuchMethodError: org.neo4j.kernel.impl.core.NodeManager.newGraphProperties()Lorg/neo4j/kernel/impl/core/GraphPropertiesImpl;
    at com.graphaware.common.kv.GraphKeyValueStore.<init>(GraphKeyValueStore.java:32)
    at com.graphaware.runtime.metadata.GraphPropertiesMetadataRepository.<init>(GraphPropertiesMetadataRepository.java:55)
    at com.graphaware.runtime.GraphAwareRuntimeFactory.createRuntime(GraphAwareRuntimeFactory.java:63)
    at com.graphaware.runtime.bootstrap.RuntimeKernelExtension.start(RuntimeKernelExtension.java:111)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
    ... 15 more

When I comment out the graphaware.runtime.enabled = true line in my neo4j.properties, neo4j starts without issue. This happens both when starting up a fresh database and one with existing data.

It's also happening when I replace 2.3.1.36 with 2.3.1.35, which leads me to think this is a problem with my setup rather than a bug in the framework (as I assume no such bug would've been allowed to persist across two versions).

Is there something obvious that could cause this exception?

Here are my POM dependencies, happy to provide any other info as needed.

<properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <neo4j.version>2.3.1</neo4j.version>
    <graphaware.version>2.3.1.36</graphaware.version>
</properties>
<dependencies>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j</artifactId>
        <version>${neo4j.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j.app</groupId>
        <artifactId>neo4j-server</artifactId>
        <version>${neo4j.version}</version>
        <type>test-jar</type>
    </dependency>
    <dependency>
        <groupId>org.neo4j.test</groupId>
        <artifactId>neo4j-harness</artifactId>
        <version>${neo4j.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.5.4</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.5.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.5.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.jaxrs</groupId>
        <artifactId>jackson-jaxrs-json-provider</artifactId>
        <version>2.5.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-jaxb-annotations</artifactId>
        <version>2.5.4</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.github.javafaker</groupId>
        <artifactId>javafaker</artifactId>
        <version>0.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.graphaware.neo4j</groupId>
        <artifactId>runtime-api</artifactId>
        <version>${graphaware.version}</version>
    </dependency>
    <dependency>
        <groupId>com.graphaware.neo4j</groupId>
        <artifactId>runtime</artifactId>
        <version>${graphaware.version}</version>
    </dependency>
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client</artifactId>
        <version>1.20.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-civicinfo</artifactId>
        <version>v2-rev10-1.20.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson2</artifactId>
        <version>1.20.0</version>
    </dependency>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>jsr311-api</artifactId>
        <version>1.1.1</version>
    </dependency>

</dependencies>
bachmanm commented 8 years ago

Are you absolutely positively sure that the Neo4j instance you deploy this to is 2.3.1? The pom is correct (apart from jackson version, which should be 2.2.3 to avoid clashes with Neo4j's jackson, but that's not the cause of this problem). The error suggests you're running 2.2.x version of Neo4j.

drew-moore commented 8 years ago

Absolutely positive, yes.

I saw #32, which looked similar to this and was caused by a version mismatch, but then triple-checked to confirm I was running 2.3.1. I verified this by looking at the webadmin interface (which is easily distinguishable between 2.3.x and 2.2.x) after starting up successfully without runtime enabled. I'm away from my machine right now, but if you'll tell me what shell command will output the info shown in #32, I'd be happy to run it and post the result in a couple of hours.

I was using 2.2.5 previously, and I c/p'd a lot of config from that instance into the config files on the new 2.3.1 instance (including the graphaware-relevant bits) - could there be something be problematic there?

bachmanm commented 8 years ago

I don't think so... I'd double check you ONLY have the right graphaware version in plugins. If you're really using Neo4j 2.3.1 and GA 2.3.1.36 and the error still occurs, it would be great if you could reproduce this somewhere in the cloud (like aws), so I can ssh in and have a look. Cheers!

ikwattro commented 8 years ago

@bachmanm Just for info :

This line proves the 2.3 version : org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade

In 2.2, there is no such class and the factory package is not under impl

bachmanm commented 8 years ago

true, but org.neo4j.kernel.impl.core.NodeManager.newGraphProperties()Lorg/neo4j/kernel/impl/core/GraphPropertiesImpl; really isn't in 2.3.1.

Could you do an md5 hash of your framework .jar file? Any chance it is an older one renamed to 2.3.1.36?

drew-moore commented 8 years ago

Aye... Nope, the framework .jar was correct, but for some (clearly very bad) reason I had put common-2.2.2.31.jar in my plugins awhile back and didn't catch it when copying them into the 2.3.1 instance.

Removing that resolves the issue.