0

我正在尝试使用 neo4j 设置一个 spring 项目。但是,当我运行应用程序时,它不会启动并给出以下异常:

  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'videoRepository': Cannot resolve reference to bean 'neo4jTemplate' while setting bean property 'neo4jTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' while setting bean property 'graphDatabaseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphDatabaseService' defined in class path resource [spring/neo4j.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.neo4j.kernel.EmbeddedGraphDatabase]: Constructor threw exception; nested exception is java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager@147e32a' was successfully initialized, but failed to start. Please see attached cause exception.

  org.neo4j.kernel.impl.storemigration.StoreUpgrader$UnableToUpgradeException: Not all store files match the version required for successful upgrade

这是我的 neo4j.xml

<neo4j:repositories base-package="neo4j.repository"/> 
<neo4j:config graphDatabaseService="graphDatabaseService"/>  
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase" destroy-method="shutdown">
    <constructor-arg value="C:/Users/mario/Documents/Neo4j/default.graphdb"/>
    <constructor-arg>
        <map>
            <entry key="allow_store_upgrade" value="true"/>
        </map>
    </constructor-arg>
</bean>

我假设这个问题是由 allow_store_upgrade 引起的。如果我删除或将此属性设置为 false,则会引发异常,建议我将其设置为 true。真正导致此问题的原因是什么,我该如何解决?

4

0 回答 0