Neo4j TestGraphDatabase:引起:java.lang.IllegalStateException:在仍然映射文件时无法关闭PageCache:

时间:2016-04-14 02:31:26

标签: neo4j

我正在尝试按照the documentation here.

进行neo4j单元测试

我已经完全复制了代码(禁止我删除的断言语句)。

我正在使用相同的Maven依赖项,除了我使用的是版本2.2.3

当我运行测试时,我得到了这个堆栈跟踪:

2016-04-14 02:23:25.832+0000 ERROR [org.neo4j]: Lifecycle exception Failed to transition component 'org.neo4j.kernel.impl.pagecache.PageCacheLifecycle@6f4adfd6' from STOPPED to SHUTTING_DOWN. Please see attached cause exception
org.neo4j.kernel.lifecycle.LifecycleException: Failed to transition component 'org.neo4j.kernel.impl.pagecache.PageCacheLifecycle@6f4adfd6' from STOPPED to SHUTTING_DOWN. Please see attached cause exception
<snip>
Caused by: java.lang.IllegalStateException: Cannot close the PageCache while files are still mapped:
    neostore.counts.db.a (1 mapping)
    neostore (1 mapping)
    neostore.relationshipgroupstore.db (1 mapping)
    neostore.schemastore.db (1 mapping)
    neostore.nodestore.db (1 mapping)
    neostore.nodestore.db.labels (1 mapping)
    neostore.relationshipstore.db (1 mapping)
    neostore.propertystore.db (1 mapping)
    neostore.propertystore.db.arrays (1 mapping)
    neostore.propertystore.db.strings (1 mapping)
    neostore.propertystore.db.index (1 mapping)
    neostore.propertystore.db.index.keys (1 mapping)
    neostore.labeltokenstore.db (1 mapping)
    neostore.labeltokenstore.db.names (1 mapping)
    neostore.relationshiptypestore.db (1 mapping)
    neostore.relationshiptypestore.db.names (1 mapping)
    at org.neo4j.io.pagecache.impl.muninn.MuninnPageCache.close(MuninnPageCache.java:483)
    at org.neo4j.kernel.impl.pagecache.PageCacheLifecycle.shutdown(PageCacheLifecycle.java:42)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.shutdown(LifeSupport.java:555)
    ... 27 more

我尝试升级到版本2.3.3,但后来又出现了不同的错误:

Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions@5c86c46a' failed to initialize. Please see attached cause exception.
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:434)
    at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102)
    at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
    ... 30 more
Caused by: java.lang.NoClassDefFoundError: org/neo4j/kernel/logging/Logging

According to Grepcode有意义,org.neo4j.kernel.logging.Logging仅存在版本2.2.3

这里可能出现的问题是什么? - 这是一个依赖不兼容的问题?

1 个答案:

答案 0 :(得分:2)

问题是我将spring-data-neo4j 3.4.0.RELEASE作为未使用的依赖项,这导致了问题。删除它并使用neo4j 2.3.3