我将Neo4j-Database从2.2.0升级到3.0.3。我收到以下错误消息尝试从Java启动它:
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, F:\DLs\DB
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:144)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:40)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:100)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.lambda$createDatabaseCreator$203(GraphDatabaseFactory.java:89)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$$Lambda$1/1020923989.newDatabase(Unknown Source)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:183)
at Neo4j.Neo4j.startServer(Neo4j.java:22)
at countAnnotator.Main.main(Main.java:32)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions@42cdc8d0' failed to initialize. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:416)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:62)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:98)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:140)
... 8 more
Caused by: java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.neo4j.kernel.api.impl.labelscan.storestrategy.BitmapDocumentFormat.<clinit>(BitmapDocumentFormat.java:40)
at org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder.<init>(LuceneLabelScanIndexBuilder.java:34)
at org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder.create(LuceneLabelScanIndexBuilder.java:49)
at org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension.getLuceneIndex(LuceneLabelScanStoreExtension.java:90)
at org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension.newInstance(LuceneLabelScanStoreExtension.java:79)
at org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension.newInstance(LuceneLabelScanStoreExtension.java:40)
at org.neo4j.kernel.extension.KernelExtensions.init(KernelExtensions.java:69)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:406)
... 11 more
这是相关的代码:
public class Neo4j {
static File dir = new File("F:/DLs/DB/");
GraphDatabaseService graphDb;
public void startServer(){
graphDb = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder( dir )
.setConfig( GraphDatabaseSettings.read_only, "true" )
.newGraphDatabase();
registerShutdownHook( graphDb );
}
}
这些是我在POM中的Neo4j-Jars:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-bolt</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>3.0.3</version>
</dependency>
可悲的是,我对Maven和Neo4j的经验都很少,我无法找出问题的根源 我尝试使用旧数据库版本(2.2.0)中的依赖项,但得到错误消息&#34; neostore.nodestore.db不包含商店版本&#34;
我可以通过Neo4j-3.0.3-Application运行数据库而不会出现问题。
任何帮助将不胜感激!
答案 0 :(得分:0)
所以我确实能够通过创建一个没有任何其他依赖项的新项目并运行正常运行的代码来确认这是一个buildpathissue。
感谢您的帮助!
编辑: 我现在找到了问题的原因: 我将dbpedia-spotlight.jar作为外部存档,其中还包含lucene-jars,这会在尝试启动Neo4j-Server时导致错误。