0

任何人都可以建议我使用哪个 jar 来解决以下异常,

Exception in thread "main" java.lang.NoSuchMethodError: org.neo4j.graphdb.factory.GraphDatabaseSetting$BooleanSetting.<init>(Ljava/lang/String;)V
    at org.neo4j.shell.ShellSettings.<clinit>(ShellSettings.java:37)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source)
    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
    at java.lang.reflect.Field.get(Unknown Source)
    at org.neo4j.kernel.configuration.AnnotatedFieldHarvester.findStatic(AnnotatedFieldHarvester.java:47)
    at org.neo4j.kernel.configuration.AnnotationBasedConfigurationMigrator.<init>(AnnotationBasedConfigurationMigrator.java:40)
    at org.neo4j.kernel.configuration.Config.<init>(Config.java:89)
    at org.neo4j.kernel.InternalAbstractGraphDatabase.<init>(InternalAbstractGraphDatabase.java:218)
    at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:103)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
    at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
    at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69)
    at com.Neo4J.src.EmbeddedNeo4j.createDb(EmbeddedNeo4j.java:48)
    at com.Neo4J.src.EmbeddedNeo4j.main(EmbeddedNeo4j.java:38). 

我已经包含了下面的罐子,

neo4j-内核-1.9.3.jar。谢谢。

4

1 回答 1

2

确保您有匹配的 neo4j-shell jar 文件。

该命令javap -v -classpath neo4j-shell-1.9.3.jar org.neo4j.shell.ShellSettings | grep invoke向我表明只有五个方法被调用ShellSettings。一种是Object默认构造函数,但那是在构造函数期间ShellSettings,而不是静态类初始化<clinit>。其他人都是班里的org.neo4j.helpers.Settingssetting被调用四次,在两个不同的重载版本中,matches每次illegalValueMessage调用一次。

所以在 1.9.3 版本的 neo4j 中,GraphDatabaseSetting$BooleanSetting不会发生对堆栈跟踪中提到的构造函数的调用。因此,您的ShellSettings课程必须来自与 1.9.3 二进制不兼容的其他版本。使用兼容的版本,你应该没问题。

于 2013-10-01T13:13:41.953 回答