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

时间:2015-05-18 14:55:53

标签: neo4j spatial spring-data-neo4j

我试图制作neo4j-spatial版本0.14-neo4j-2.2.0,在服务器模式下使用spring-data-neo4j-rest版本3.3.0.RELEASE和neo4j CE 2.2.1。

看起来它们不兼容。尝试创建类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)不再提供类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,但仍然无法工作,我得到一个缺少的类org / neo4j / kernel / impl / nioneo / store / StoreId

所以我" git clone" spring-data-neo4j-rest on local和build version 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缺失

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

感谢。

以防万一,这里是maven依赖:具有spring-data-neo4j-rest本地构建的树,没有覆盖neo4j-kernel版本2.1.7:

[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

1 个答案:

答案 0 :(得分:0)

还没有,抱歉,我名单上的许多待办事项之一:(。

但是对于REST-Server而言,它并不重要。您可以将空间插件部署到Neo4j-Server,然后它应该通过REST API使用索引。

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

再次抱歉。