0

在我的 maven 项目中,我使用(除其他外)嵌入式-neo4j、slf4j-api 1.7.2 和 logback 1.0.13。暂时我正在使用neo4j 1.8,我想升级到neo4j 1.9。

这样做时,我从 neo4j 中得到一个与日志相关的 ClassCastException [1]。从我的项目中删除 logback 解决了这个问题。mvn-dependency:tree 已附加 [2]。

如何在不删除 logback 的情况下更新到嵌入式 neo4j1.9?

[1]

java.lang.ClassCastException: org.slf4j.impl.JDK14LoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext
at org.neo4j.kernel.InternalAbstractGraphDatabase.createLogging(InternalAbstractGraphDatabase.java:772)
at org.neo4j.kernel.InternalAbstractGraphDatabase.create(InternalAbstractGraphDatabase.java:316)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:253)
at org.neo4j.kernel.EmbeddedGraphDatabase.(EmbeddedGraphDatabase.java:106)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69)
at com.bestellbaer.provider.Neo4jProvider.init(Neo4jProvider.java:59)
at com.bestellbaer.provider.Provider.init(Provider.java:20)
at com.bestellbaer.test.DomainTest.prepareTestDatabase(DomainTest.java:530)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
[...]

[2]

[INFO] bestellbaer:bestellbaer-classic-webapp:war:trunk-SNAPSHOT
[INFO] +- org.slf4j:slf4j-api:jar:1.7.2:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.13:compile
[INFO] |  \- ch.qos.logback:logback-core:jar:1.0.13:compile
[INFO] +- org.neo4j:neo4j:jar:1.8:compile
[INFO] |  +- org.neo4j:neo4j-kernel:jar:1.8:compile
[INFO] |  +- org.neo4j:neo4j-lucene-index:jar:1.8:compile
[INFO] |  |  \- org.apache.lucene:lucene-core:jar:3.5.0:compile
[INFO] |  +- org.neo4j:neo4j-graph-algo:jar:1.8:compile
[INFO] |  +- org.neo4j:neo4j-udc:jar:1.8:compile
[INFO] |  +- org.neo4j:neo4j-graph-matching:jar:1.8:compile
[INFO] |  +- org.neo4j:neo4j-cypher:jar:1.8:compile
[INFO] |  |  \- org.scala-lang:scala-library:jar:2.9.1-1:compile
[INFO] |  \- org.neo4j:neo4j-jmx:jar:1.8:compile
[INFO] +- org.neo4j:neo4j-kernel:jar:tests:1.8:compile
[INFO] |  \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] +- com.tinkerpop.gremlin:gremlin-groovy:jar:2.3.0:compile
[INFO] |  +- com.tinkerpop.gremlin:gremlin-java:jar:2.3.0:compile
[INFO] |  |  \- com.tinkerpop.blueprints:blueprints-core:jar:2.3.0:compile
[INFO] |  |     +- org.codehaus.jettison:jettison:jar:1.3.3:compile
[INFO] |  |     |  \- stax:stax-api:jar:1.0.1:compile
[INFO] |  |     +- com.fasterxml.jackson.datatype:jackson-datatype-    json-org:jar:2.1.2:compile
[INFO] |  |     |  +- com.fasterxml.jackson.core:jackson-core:jar:2.1.2:compile
[INFO] |  |     |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.1.2:compile
[INFO] |  |     |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.1:compile
[INFO] |  |     |  \- org.json:json:jar:20080701:compile
[INFO] |  |     \- colt:colt:jar:1.2.0:compile
[INFO] |  |        \- concurrent:concurrent:jar:1.3.4:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.0.4:compile
[INFO] |  +- com.tinkerpop:pipes:jar:2.3.0:compile
[INFO] |  +- org.codehaus.groovy:groovy:jar:1.8.9:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- asm:asm:jar:3.2:compile
[INFO] |  |  +- asm:asm-commons:jar:3.2:compile
[INFO] |  |  +- asm:asm-util:jar:3.2:compile
[INFO] |  |  +- asm:asm-analysis:jar:3.2:compile
[INFO] |  |  \- asm:asm-tree:jar:3.2:compile
[INFO] |  \- org.fusesource.jansi:jansi:jar:1.5:compile
[INFO] +- org.neo4j:neo4j-spatial:jar:0.10.1:compile
[INFO] |  +- org.neo4j:neo4j-graph-collections:jar:0.5:compile
[INFO] |  +- org.geotools:gt-main:jar:8.4:compile
[INFO] |  |  +- org.geotools:gt-api:jar:8.4:compile
[INFO] |  |  +- com.vividsolutions:jts:jar:1.12:compile
[INFO] |  |  |  \- xerces:xercesImpl:jar:2.11.0:test (version managed from 2.4.0; scope managed from compile)
[INFO] |  |  |     \- xml-apis:xml-apis:jar:1.4.01:test
[INFO] |  |  +- jdom:jdom:jar:1.0:compile
[INFO] |  |  \- javax.media:jai_core:jar:1.1.3:compile
[INFO] |  +- org.geotools:gt-shapefile:jar:8.4:compile
[INFO] |  |  +- org.geotools:gt-data:jar:8.4:compile
[INFO] |  |  \- org.geotools:gt-referencing:jar:8.4: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:8.4:compile
[INFO] |  |     |  \- org.geotools:gt-opengis:jar:8.4: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:8.4:compile
[INFO] |  |  +- org.geotools:gt-coverage:jar:8.4:compile
[INFO] |  |  |  +- it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.5:compile
[INFO] |  |  |  |  +- it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.5: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:8.4:compile
[INFO] |  |  \- javax.media:jai_imageio:jar:1.1:compile
[INFO] |  +- org.geotools:gt-render:jar:8.4:compile
[INFO] |  \- commons-lang:commons-lang:jar:2.4:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-tx:jar:3.1.4.RELEASE:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-context:jar:3.1.4.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-asm:jar:3.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:3.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-aspects:jar:3.1.4.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-context-support:jar:3.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-core:jar:3.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-expression:jar:3.1.4.RELEASE:compile
[INFO] |  +- org.aspectj:aspectjrt:jar:1.7.2:compile
[INFO] |  +- org.springframework.data:spring-data-commons:jar:1.5.1.RELEASE:compile
[INFO] |  +- org.neo4j:neo4j-cypher-dsl:jar:1.9.M04:compile
[INFO] |  \- org.slf4j:jcl-over-slf4j:jar:1.7.1:runtime
[INFO] +- org.springframework.data:spring-data-neo4j-aspects:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:3.1.4.RELEASE:compile
[INFO] |  \- cglib:cglib:jar:2.2:compile
[INFO] +- org.springframework.data:spring-data-neo4j-rest:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.neo4j:neo4j-rest-graphdb:jar:1.8.1:compile
[INFO] |  |  \- org.neo4j:server-api:jar:1.8.1:compile
[INFO] |  |     +- org.neo4j.3rdparty.javax.ws.rs:jsr311-api:jar:1.1.2.r612:compile
[INFO] |  |     +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] |  |     |  +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] |  |     |  \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] |  |     \- commons-digester:commons-digester:jar:1.8.1:compile
[INFO] |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.7:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-core-asl:jar:1.9.7:compile
[INFO] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.7:compile
[INFO] |  \- com.sun.jersey:jersey-client:jar:1.4:compile
[INFO] |     \- com.sun.jersey:jersey-core:jar:1.4:compile
[INFO] +- org.hibernate:hibernate-validator:jar:4.3.1.Final:compile
[INFO] |  +- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO] |  \- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:compile
[INFO] +- joda-time:joda-time:jar:2.2:compile
[INFO] +- org.omnifaces:omnifaces:jar:1.4.1:compile
[INFO] +- org.primefaces:primefaces:jar:3.5.5-UR:compile
[INFO] +- org.primefaces:primefaces-mobile:jar:0.9.4:compile
[INFO] +- org.primefaces.themes:flick:jar:1.0.10:compile
[INFO] +- org.atmosphere:atmosphere-runtime:jar:1.0.13:compile
[INFO] |  +- org.atmosphere:atmosphere-compat-jbossweb:jar:1.0.13:compile
[INFO] |  +- org.atmosphere:atmosphere-compat-tomcat:jar:1.0.13:compile
[INFO] |  \- org.atmosphere:atmosphere-compat-tomcat7:jar:1.0.13:compile
[INFO] +- org.apache.shiro:shiro-core:jar:1.2.1:compile
[INFO] |  \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- org.apache.shiro:shiro-web:jar:1.2.1:compile
[INFO] +- org.apache.shiro:shiro-faces:jar:2.0-SNAPSHOT:compile
[INFO] +- com.google.zxing:javase:jar:2.1:compile
[INFO] |  \- com.google.zxing:core:jar:2.1:compile
[INFO] +- org.apache.pdfbox:pdfbox:jar:1.8.1:compile
[INFO] |  +- org.apache.pdfbox:fontbox:jar:1.8.1:compile
[INFO] |  \- org.apache.pdfbox:jempbox:jar:1.8.1:compile
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] +- junit:junit:jar:4.11:test (scope not updated to compile)
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.mockito:mockito-all:jar:1.9.5:test
[INFO] +- org.jvnet.mock-javamail:mock-javamail:jar:1.9:test
[INFO] |  \- javax.mail:mail:jar:1.4:test
[INFO] |     \- javax.activation:activation:jar:1.1:test
[INFO] +- org.jacoco:org.jacoco.core:jar:0.6.2.201302030002:test
[INFO] |  \- org.ow2.asm:asm-all:jar:4.1:test
[INFO] +- org.seleniumhq.selenium:selenium-java:jar:2.33.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-android-driver:jar:2.33.0:test
[INFO] |  |  \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.33.0:test
[INFO] |  |     +- cglib:cglib-nodep:jar:2.1_3:test
[INFO] |  |     \- com.google.guava:guava:jar:14.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.33.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.33.0:test
[INFO] |  |  +- net.sourceforge.htmlunit:htmlunit:jar:2.12:test
[INFO] |  |  |  +- xalan:xalan:jar:2.7.1:test
[INFO] |  |  |  |  \- xalan:serializer:jar:2.7.1:test
[INFO] |  |  |  +- org.apache.commons:commons-lang3:jar:3.1:test
[INFO] |  |  |  +- org.apache.httpcomponents:httpmime:jar:4.2.3:test
[INFO] |  |  |  +- commons-codec:commons-codec:jar:1.7:test
[INFO] |  |  |  +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.12:test
[INFO] |  |  |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.18:test
[INFO] |  |  |  +- net.sourceforge.cssparser:cssparser:jar:0.9.9:test
[INFO] |  |  |  |  \- org.w3c.css:sac:jar:1.3:test
[INFO] |  |  |  \- org.eclipse.jetty:jetty-websocket:jar:8.1.9.v20130131:test
[INFO] |  |  |     +- org.eclipse.jetty:jetty-util:jar:8.1.9.v20130131:test
[INFO] |  |  |     +- org.eclipse.jetty:jetty-io:jar:8.1.9.v20130131:test
[INFO] |  |  |     \- org.eclipse.jetty:jetty-http:jar:8.1.9.v20130131:test
[INFO] |  |  \- org.apache.httpcomponents:httpclient:jar:4.2.1:test
[INFO] |  |     \- org.apache.httpcomponents:httpcore:jar:4.2.1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.33.0:test
[INFO] |  |  +- commons-io:commons-io:jar:2.2:test
[INFO] |  |  \- org.apache.commons:commons-exec:jar:1.1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.33.0:test
[INFO] |  |  +- net.java.dev.jna:jna:jar:3.4.0:test
[INFO] |  |  \- net.java.dev.jna:platform:jar:3.4.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.33.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.33.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-support:jar:2.33.0:test
[INFO] |  |  \- org.seleniumhq.selenium:selenium-api:jar:2.33.0:test
[INFO] |  \- org.webbitserver:webbit:jar:0.4.14:test
[INFO] |     \- io.netty:netty:jar:3.5.2.Final:test
[INFO] \- org.glassfish.main.extras:glassfish-embedded-all:jar:3.1.2.2:provided
4

1 回答 1

2

Neo4j 1.9 似乎存在问题,拉取请求已经在https://github.com/neo4j/neo4j/pull/847可用。

作为一种解决方法,请尝试从依赖关系树中排除 logback-classic。

[2013-06-28 更新] Neo4j 1.9.1 已发布,建议的解决方法已过时。

于 2013-06-01T16:59:43.657 回答