neo4j-spatial 与 spring-data-neo4j-rest 和 neo4j CE 2.2.1 服务器模式的兼容性?

Compatibility neo4j-spatial with spring-data-neo4j-rest and neo4j CE 2.2.1 server mode?

我正在尝试制作 neo4j-spatial 版本 0.14-neo4j-2.2.0,与 spring-data-neo4j-rest 版本 3.3 一起使用。0.RELEASE 与 neo4j CE 2.2.1在服务器模式下。

看起来它们不兼容。尝试创建 class EditableLayer 的新实例会引发 NoSuchMethod 异常。

例如:

EditableLayer layer = (EditableLayer) spatialDb.getOrCreateLayer( "layer",SimplePointEncoder.class, EditableLayerImpl.class);

我得到异常:

SEVERE: Servlet.service() for servlet [com.stampy.foundation.remote.RestConfiguration] in context with path [/stampy-server] threw exception [java.lang.RuntimeException: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.neo4j.graphdb.GraphDatabaseService.execute(Ljava/lang/String;Ljava/util/Map;)Lorg/neo4j/graphdb/Result;] with root cause
java.lang.NoSuchMethodError: org.neo4j.graphdb.GraphDatabaseService.execute(Ljava/lang/String;Ljava/util/Map;)Lorg/neo4j/graphdb/Result;
    at org.neo4j.gis.spatial.utilities.ReferenceNodes.getReferenceNode(ReferenceNodes.java:43)
    at org.neo4j.gis.spatial.SpatialDatabaseService.getSpatialRoot(SpatialDatabaseService.java:78)
    at org.neo4j.gis.spatial.SpatialDatabaseService.getLayer(SpatialDatabaseService.java:114)
    at org.neo4j.gis.spatial.SpatialDatabaseService.getOrCreateLayer(SpatialDatabaseService.java:208)

neo4j-kernel 2.1.7 版本(此依赖来自 SDN-rest)似乎不再提供 class GraphDatabaseService 中的 execute(...) 方法。但是 Spatial 在 org.neo4j.gis.spatial.utilities.ReferenceNodes.getReferenceNode(ReferenceNodes.java:43)

中调用了这个方法
[INFO] +- org.springframework.data:spring-data-neo4j-rest:jar:3.3.0.RELEASE:compile
[INFO] |  +- org.neo4j:neo4j-kernel:jar:2.1.7:compile
[INFO] |  |  \- org.neo4j:neo4j-primitive-collections:jar:2.1.7:compile
[INFO] |  \- org.neo4j:neo4j-lucene-index:jar:2.1.7:compile
[INFO] |     \- org.apache.lucene:lucene-core:jar:3.6.2:compile

所以我尝试用 2.2.1 或 2.2.0 版本覆盖 neo4j-kernel,但仍然无法正常工作,我得到了一个缺失 class org/neo4j/kernel/impl/nioneo/store/StoreId

所以我 "git clone" spring-data-neo4j-rest 在本地并构建版本 3.4.0.BUILD-SNAPSHOT,删除对 neo4j-kernel 的覆盖...同样的错误: NoSuchMethodError:org.neo4j.graphdb.GraphDatabaseService.execute

但即使使用 neo4j-kernel 2.2.1 或 2.2.0,我仍然会遇到与之前相同的错误:org/neo4j/kernel/impl/nioneo/store/StoreId is missing

你知道我该如何解决这个问题吗?

谢谢。

以防万一,这里是本地构建 spring-data-neo4j-rest 并且没有覆盖 neo4j-kernel 版本 2.1.7 的 Maven dependency:tree:

[INFO] +- org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.34:compile
[INFO] +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:7.0.34:compile
[INFO] +- org.apache.tomcat.embed:tomcat-embed-jasper:jar:7.0.34:compile
[INFO] |  \- org.eclipse.jdt.core.compiler:ecj:jar:3.7.2:compile
[INFO] +- org.apache.tomcat:tomcat-jasper:jar:7.0.34:compile
[INFO] |  +- org.apache.tomcat:tomcat-servlet-api:jar:7.0.34:compile
[INFO] |  +- org.apache.tomcat:tomcat-juli:jar:7.0.34:compile
[INFO] |  +- org.apache.tomcat:tomcat-el-api:jar:7.0.34:compile
[INFO] |  +- org.apache.tomcat:tomcat-api:jar:7.0.34:compile
[INFO] |  \- org.apache.tomcat:tomcat-util:jar:7.0.34:compile
[INFO] +- org.apache.tomcat:tomcat-jasper-el:jar:7.0.34:compile
[INFO] +- org.apache.tomcat:tomcat-jsp-api:jar:7.0.34:compile
[INFO] +- javax.servlet:servlet-api:jar:2.4:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.0:provided
[INFO] +- javax.mail:mail:jar:1.4.1:compile
[INFO] |  \- javax.activation:activation:jar:1.1:compile
[INFO] +- antlr:antlr:jar:2.7.6:compile
[INFO] +- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.apache.commons:commons-email:jar:1.3.3:compile
[INFO] +- commons-validator:commons-validator:jar:1.4.1:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- com.google.gdata:core:jar:1.47.1:compile
[INFO] |  +- com.google.guava:guava:jar:13.0.1:compile
[INFO] |  +- com.google.oauth-client:google-oauth-client-jetty:jar:1.11.0-beta:compile
[INFO] |  |  +- com.google.oauth-client:google-oauth-client-java6:jar:1.11.0-beta:compile
[INFO] |  |  |  \- com.google.oauth-client:google-oauth-client:jar:1.11.0-beta:compile
[INFO] |  |  |     \- com.google.http-client:google-http-client:jar:1.11.0-beta:compile
[INFO] |  |  |        +- org.apache.httpcomponents:httpclient:jar:4.0.3:compile
[INFO] |  |  |        |  \- org.apache.httpcomponents:httpcore:jar:4.0.1:compile
[INFO] |  |  |        \- xpp3:xpp3:jar:1.1.4c:compile
[INFO] |  |  \- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] |  |     +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] |  |     \- org.mortbay.jetty:servlet-api:jar:2.5-20081211:compile
[INFO] |  \- com.google.code.findbugs:jsr305:jar:1.3.7:compile
[INFO] +- log4j:apache-log4j-extras:jar:1.1:compile
[INFO] +- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] |  \- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- commons-chain:commons-chain:jar:1.2:compile
[INFO] +- commons-codec:commons-codec:jar:1.4:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- commons-dbcp:commons-dbcp:jar:1.2.2:runtime
[INFO] +- commons-digester:commons-digester:jar:1.8.1:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] +- commons-io:commons-io:jar:1.4:compile
[INFO] +- commons-lang:commons-lang:jar:2.5:compile
[INFO] +- commons-net:commons-net:jar:1.4.1:compile
[INFO] |  \- oro:oro:jar:2.0.8:compile
[INFO] +- cglib:cglib-nodep:jar:2.1_3:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.17:compile
[INFO] +- com.sun.jersey:jersey-server:jar:1.19:compile
[INFO] |  \- com.sun.jersey:jersey-core:jar:1.19:compile
[INFO] |     \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] +- com.sun.jersey:jersey-client:jar:1.19:compile
[INFO] +- com.sun.jersey.contribs:jersey-apache-client:jar:1.19:compile
[INFO] +- com.sun.jersey.contribs:jersey-multipart:jar:1.19:compile
[INFO] |  \- org.jvnet.mimepull:mimepull:jar:1.9.3:compile
[INFO] +- org.jvnet:mimepull:jar:1.4:compile
[INFO] +- com.sun.jersey:jersey-json:jar:1.19:compile
[INFO] |  +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] |  |  \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] |  |     \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.2:compile
[INFO] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.2:compile
[INFO] |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.2:compile
[INFO] |  \- org.codehaus.jackson:jackson-xc:jar:1.9.2:compile
[INFO] +- com.sun.jersey.contribs:jersey-spring:jar:1.19:compile
[INFO] |  \- com.sun.jersey:jersey-servlet:jar:1.19:compile
[INFO] +- com.fasterxml:jackson-module-hibernate:jar:1.9.1:compile
[INFO] +- org.freemarker:freemarker:jar:2.3.18:compile
[INFO] +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-aspects:jar:4.1.6.RELEASE:compile
[INFO] |  \- org.aspectj:aspectjweaver:jar:1.8.5:compile
[INFO] +- org.springframework:spring-context-support:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:4.1.6.RELEASE:compile
[INFO] |  \- org.springframework:spring-aop:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-jms:jar:4.1.6.RELEASE:compile
[INFO] |  \- org.springframework:spring-messaging:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.1.6.RELEASE:compile
[INFO] |  \- org.springframework:spring-web:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:3.4.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.aspectj:aspectjrt:jar:1.8.5:compile
[INFO] |  +- org.springframework.data:spring-data-commons:jar:1.11.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.neo4j:neo4j-cypher-dsl:jar:2.0.1:compile
[INFO] |  +- org.neo4j:neo4j:jar:2.1.7:compile
[INFO] |  |  +- org.neo4j:neo4j-graph-algo:jar:2.1.7:compile
[INFO] |  |  +- org.neo4j:neo4j-udc:jar:2.1.7:compile
[INFO] |  |  +- org.neo4j:neo4j-graph-matching:jar:2.1.7:compile
[INFO] |  |  +- org.neo4j:neo4j-cypher:jar:2.1.7:compile
[INFO] |  |  |  +- org.neo4j:neo4j-cypher-commons:jar:2.1.7:compile
[INFO] |  |  |  +- org.neo4j:neo4j-cypher-compiler-1.9:jar:2.0.3:compile
[INFO] |  |  |  +- org.neo4j:neo4j-cypher-compiler-2.0:jar:2.0.3:compile
[INFO] |  |  |  +- org.neo4j:neo4j-cypher-compiler-2.1:jar:2.1.7:compile
[INFO] |  |  |  +- org.parboiled:parboiled-scala_2.10:jar:1.1.6:compile
[INFO] |  |  |  |  \- org.parboiled:parboiled-core:jar:1.1.6:compile
[INFO] |  |  |  +- net.sf.opencsv:opencsv:jar:2.3:compile
[INFO] |  |  |  +- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.3.1:compile
[INFO] |  |  |  \- org.scala-lang:scala-library:jar:2.10.4:compile
[INFO] |  |  \- org.neo4j:neo4j-jmx:jar:2.1.7:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] |  \- org.slf4j:jcl-over-slf4j:jar:1.7.10:runtime
[INFO] +- org.springframework.data:spring-data-neo4j-rest:jar:3.4.0.BUILD-SNAPSHOT:compile
[INFO] |  +- org.neo4j:neo4j-kernel:jar:2.1.7:compile
[INFO] |  |  \- org.neo4j:neo4j-primitive-collections:jar:2.1.7:compile
[INFO] |  \- org.neo4j:neo4j-lucene-index:jar:2.1.7:compile
[INFO] |     \- org.apache.lucene:lucene-core:jar:3.6.2:compile
[INFO] +- org.springframework.data:spring-data-rest-webmvc:jar:2.3.0.RELEASE:compile
[INFO] |  +- org.springframework.data:spring-data-rest-core:jar:2.3.0.RELEASE:compile
[INFO] |  |  +- org.springframework.hateoas:spring-hateoas:jar:0.17.0.RELEASE:compile
[INFO] |  |  |  \- org.objenesis:objenesis:jar:2.1:compile
[INFO] |  |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  |  \- org.atteo:evo-inflector:jar:1.2.1:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.5.1:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.5.1:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.1:compile
[INFO] |  \- com.github.fge:json-patch:jar:1.7:compile
[INFO] |     \- com.github.fge:jackson-coreutils:jar:1.6:compile
[INFO] |        \- com.github.fge:msg-simple:jar:1.1:compile
[INFO] |           \- com.github.fge:btf:jar:1.2:compile
[INFO] +- org.neo4j:neo4j-spatial:jar:0.14-neo4j-2.2.0:compile
[INFO] |  +- org.geotools:gt-main:jar:9.2:compile
[INFO] |  |  +- org.geotools:gt-api:jar:9.2:compile
[INFO] |  |  +- com.vividsolutions:jts:jar:1.13:compile
[INFO] |  |  +- jdom:jdom:jar:1.0:compile
[INFO] |  |  \- javax.media:jai_core:jar:1.1.3:compile
[INFO] |  +- org.geotools:gt-shapefile:jar:9.2:compile
[INFO] |  |  +- org.geotools:gt-data:jar:9.2:compile
[INFO] |  |  \- org.geotools:gt-referencing:jar:9.2:compile
[INFO] |  |     +- java3d:vecmath:jar:1.3.2:compile
[INFO] |  |     +- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] |  |     +- org.geotools:gt-metadata:jar:9.2:compile
[INFO] |  |     |  \- org.geotools:gt-opengis:jar:9.2:compile
[INFO] |  |     |     \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
[INFO] |  |     \- jgridshift:jgridshift:jar:1.0:compile
[INFO] |  +- org.geotools:gt-process:jar:9.2:compile
[INFO] |  |  +- org.geotools:gt-coverage:jar:9.2:compile
[INFO] |  |  |  +- it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.7:compile
[INFO] |  |  |  |  +- it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.7:compile
[INFO] |  |  |  |  \- javax.media:jai_codec:jar:1.1.3:compile
[INFO] |  |  |  +- org.jaitools:jt-zonalstats:jar:1.3.0:compile
[INFO] |  |  |  \- org.jaitools:jt-utils:jar:1.3.0:compile
[INFO] |  |  +- org.geotools:gt-cql:jar:9.2:compile
[INFO] |  |  \- javax.media:jai_imageio:jar:1.1:compile
[INFO] |  +- org.geotools:gt-render:jar:9.2:compile
[INFO] |  \- com.googlecode.json-simple:json-simple:jar:1.1:compile
[INFO] +- org.hibernate:hibernate-core:jar:3.6.5.Final:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile
[INFO] |  \- javax.transaction:jta:jar:1.1:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
[INFO] +- org.hibernate:hibernate-validator-annotation-processor:jar:4.1.0.Final:compile
[INFO] |  \- org.hibernate:hibernate-validator:jar:4.1.0.Final:compile
[INFO] +- javassist:javassist:jar:3.12.0.GA:compile
[INFO] +- joda-time:joda-time:jar:1.6.2:compile
[INFO] +- joda-time:joda-time-hibernate:jar:1.3:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] +- org.bouncycastle:bcprov-ext-jdk15on:jar:1.47:compile
[INFO] +- org.jasypt:jasypt:jar:1.8:compile
[INFO] +- junit:junit:jar:3.8.2:test
[INFO] +- junit:junit-dep:jar:4.8.1:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- org.springframework.security:spring-security-core:jar:4.0.1.RELEASE:compile
[INFO] \- javax.validation:validation-api:jar:1.1.0.Final:compile

还没有,抱歉,我列表中的众多待办事项之一:(。

但对于 REST-Server 来说应该无关紧要。您可以将空间插件部署到 Neo4j-Server,然后它应该通过 REST API.

使用索引

对于嵌入式,您必须等到 SDN 3.3 与 Neo4j 2.2 兼容

再次抱歉。