java.lang.RuntimeException:启动org.neo4j.kernel.EmbeddedGraphDatabase

时间:2015-08-31 12:25:49

标签: java maven neo4j lucene

在我的项目中,我正在使用neo4j 2.2.5版,它与lucene中的pom.xml依赖项冲突,因为我检查了相同的代码而没有lucene依赖,这很好,所以如何在没有冲突的情况下在同一个项目中使用luceneneo4j

ERROR:

  

java.lang.RuntimeException:启动org.neo4j.kernel.EmbeddedGraphDatabase,E:\ neo4j时出错       在org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:335)       在org.neo4j.kernel.EmbeddedGraphDatabase。(EmbeddedGraphDatabase.java:59)       at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:108)       at org.neo4j.graphdb.factory.GraphDatabaseFactory $ 1.newDatabase(GraphDatabaseFactory.java:95)       at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:176)       at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:67)       在neo4j.graphdbtest.IndexSearchExample.initDB(IndexSearchExample.java:42)       在com.sessa.col.spr.act.process_flow.Flow.startProcess(Flow.java:56)       在com.sessa.col.spr.act.process_flow.FlowHandler.main(FlowHandler.java:17)   引起:org.neo4j.kernel.lifecycle.LifecycleException:组件'org.neo4j.kernel.extension.KernelExtensions@17973d6f'初始化失败。请参阅附件原因例外。       在org.neo4j.kernel.lifecycle.LifeSupport $ LifecycleInstance.init(LifeSupport.java:489)       在org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:72)       在org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:106)       在org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:331)       ......还有8个   引起:java.lang.NoClassDefFoundError:org / apache / lucene / document / Fieldable       在org.neo4j.kernel.api.impl.index.NodeRangeDocumentLabelScanStorageStrategy。(NodeRangeDocumentLabelScanStorageStrategy.java:71)       在org.neo4j.kernel.api.impl.index.LuceneLabelScanStoreExtension.newKernelExtension(LuceneLabelScanStoreExtension.java:73)       在org.neo4j.kernel.api.impl.index.LuceneLabelScanStoreExtension.newKernelExtension(LuceneLabelScanStoreExtension.java:39)       在org.neo4j.kernel.extension.KernelExtensions.init(KernelExtensions.java:66)       在org.neo4j.kernel.lifecycle.LifeSupport $ LifecycleInstance.init(LifeSupport.java:483)       ......还有11个   引起:java.lang.ClassNotFoundException:org.apache.lucene.document.Fieldable       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)       ......还有16个

的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.sessa.col.spr.act</groupId>
<artifactId>Color-Spreading-Activation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Color-Spreading-Activation</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.4</version>
    </dependency>

    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j</artifactId>
        <version>2.2.5</version>
    </dependency>

    <dependency>
        <groupId>edu.stanford.nlp</groupId>
        <artifactId>stanford-corenlp</artifactId>
        <version>3.5.2</version>
    </dependency>

    <dependency>
        <groupId>edu.stanford.nlp</groupId>
        <artifactId>stanford-parser</artifactId>
        <version>3.5.2</version>
    </dependency>

    <dependency>
        <groupId>edu.stanford.nlp</groupId>
        <artifactId>stanford-corenlp</artifactId>
        <version>3.5.2</version>
        <classifier>models</classifier>
    </dependency>

    <dependency>
        <groupId>com.sparsity</groupId>
        <artifactId>sparkseejava</artifactId>
        <version>5.1.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.jena</groupId>
        <artifactId>jena-tdb</artifactId>
        <version>1.1.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.opennlp</groupId>
        <artifactId>opennlp-tools</artifactId>
        <version>1.5.3</version>
    </dependency>

    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>5.3.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-analyzers-common</artifactId>
        <version>5.3.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-queryparser</artifactId>
        <version>5.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-queries</artifactId>
        <version>5.3.0</version>
    </dependency>

</dependencies>

1 个答案:

答案 0 :(得分:3)

在一个Maven项目中无法使用Neo4j和最新版本的Lucene。 Neo4j正在使用3.6版本。

您有两个选择

  1. 编写自己的类加载器

  2. 使用Maven Shade插件