Neo4j 2.2.3 ClassNotFoundException:org.neo4j.kernel.impl.transaction.XaDataSourceManager

时间:2015-07-30 17:20:43

标签: maven neo4j spring-data-neo4j

这是我对Neo4j的Maven配置:

    <properties>
        <neo4j.version>2.2.3</neo4j.version>
    </properties>

    <!-- neo4j -->
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-enterprise</artifactId>
        <version>${neo4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-ha</artifactId>
        <version>${neo4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-kernel</artifactId>
        <version>${neo4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-kernel</artifactId>
        <version>${neo4j.version}</version>
        <classifier>tests</classifier>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-io</artifactId>
        <version>${neo4j.version}</version>
        <classifier>tests</classifier>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-lucene-index</artifactId>
        <version>${neo4j.version}</version>
    </dependency>

在应用程序启动期间,我有以下例外:

Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions@30bb7d0d' failed to initialize. Please see attached cause exception.
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:489)
    at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:72)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:106)
    at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:331)
    ... 127 more
Caused by: java.lang.NoClassDefFoundError: org/neo4j/kernel/impl/transaction/XaDataSourceManager
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.privateGetPublicMethods(Unknown Source)
    at java.lang.Class.getMethods(Unknown Source)
    at sun.misc.ProxyGenerator.generateClassFile(Unknown Source)
    at sun.misc.ProxyGenerator.generateProxyClass(Unknown Source)
    at java.lang.reflect.Proxy$ProxyClassFactory.apply(Unknown Source)
    at java.lang.reflect.Proxy$ProxyClassFactory.apply(Unknown Source)
    at java.lang.reflect.WeakCache$Factory.get(Unknown Source)
    at java.lang.reflect.WeakCache.get(Unknown Source)
    at java.lang.reflect.Proxy.getProxyClass0(Unknown Source)
    at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
    at org.neo4j.kernel.extension.KernelExtensions.getKernelExtensionDependencies(KernelExtensions.java:119)
    at org.neo4j.kernel.extension.KernelExtensions.init(KernelExtensions.java:62)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:483)
    ... 130 more
Caused by: java.lang.ClassNotFoundException: org.neo4j.kernel.impl.transaction.XaDataSourceManager
    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)
    ... 145 more

我无法找到XaDataSourceManager所在的位置。

1 个答案:

答案 0 :(得分:2)

Xadatasource出现在neo4j-kernal jar中,但是在2.2.2之前有jar版本。由于您使用的是2.2.3,因此您将无法在jar中找到该类。我认为您使用的jar版本不兼容。尝试添加父jar并让它引用兼容的jar。