neo4j enterprise 1.8.1 Cypher ExecuteEngine bug?

时间:2013-02-20 15:55:13

标签: grails neo4j

我在grails上运行neo4j enterprise 1.8并希望升级到1.8.1。由于我还广泛使用Cypher引擎,升级后我尝试执行一些查询。不幸的是,我在尝试启动Cypher ExecutionEngine时遇到了异常。

我写了一个小服务,为我做了工作:

import org.neo4j.cypher.javacompat.ExecutionEngine
import org.neo4j.kernel.impl.util.StringLogger

class CypherService {

    def graphDatabaseService

    static transactional = true

    def executeString(String cypherString) {
        log.debug "start method executeString"

        ExecutionEngine executionEngine = new ExecutionEngine(graphDatabaseService, StringLogger.DEV_NULL)
        if(executionEngine) {
            def result = executionEngine.execute(cypherString)
            return result
        } else {
            log.error "Could not initialize the execution engine for Cypher"
            return null
        }
    }
}

启动执行引擎时,我得到以下例外:

java.lang.NoSuchMethodError: com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Builder;
at org.neo4j.cypher.internal.LRUCache.<init>(LRUCache.scala:31)
at org.neo4j.cypher.ExecutionEngine$$anon$1.<init>(ExecutionEngine.scala:91)
at org.neo4j.cypher.ExecutionEngine.<init>(ExecutionEngine.scala:91)
at org.neo4j.cypher.javacompat.ExecutionEngine.<init>(ExecutionEngine.java:54)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:202)
at com.netjay.fanorakel.CypherService.executeString(CypherService.groovy:16)

知道这里出了什么问题,是否有解决方案可以避免这种情况?

最佳

迈克尔

3 个答案:

答案 0 :(得分:1)

你可能也可以只针对旧版本的lib重建Neo4j的cypher模块,或者实际上从neo4j中排除依赖。

答案 1 :(得分:0)

我有同样的问题 - 1.8.1我需要单独包含concurrentlinkedhashmap-lru.1.3.1.jar

http://code.google.com/p/concurrentlinkedhashmap/downloads/detail?name=concurrentlinkedhashmap-lru-1.3.1.jar&can=2&q=

答案 2 :(得分:0)

这里的问题是:

  • Neo4j 1.8.1向concurrentlinkedhashmap_lru版本1.3.1引入了新依赖项,AND
  • Grails依赖于concurrentlinkedhashmap_lru版本1.2_jdk5,AND
  • concurrentlinkedhashmap_lru的API不会向后兼容这两个版本。

因此,最近升级了grails代码库以将依赖关系移动到1.3.1,请参阅https://github.com/SpringSource/grails-data-mapping/commit/b15e207a2a08ac16e77de399733cb9cc14eff48ehttps://github.com/grails/grails-core/commit/6dfab1a5db4da8c176351f23d65c7fc0d4aa6364

因此,要使用Grails使用Neo4j 1.8.1(及更新版本),您可以等待新的Grails版本或自行构建Grails snaptshot。