我正在尝试将Spring Boot从1.5升级到2.0,并面临码头版本的问题。我是neo4j ogm和spring boot的新手。
当我尝试运行测试用例时,它失败并显示以下错误。
java.lang.NoClassDefFoundError:org / eclipse / jetty / server / SessionManager 在org.neo4j.server.CommunityNeoServer.createWebServer(CommunityNeoServer.java:90) 在org.neo4j.server.AbstractNeoServer.init(AbstractNeoServer.java:188) 在org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:204) 在org.neo4j.harness.internal.InProcessServerControls.start(InProcessServerControls.java:71) 在org.neo4j.harness.internal.AbstractInProcessServerBuilder.newServer(AbstractInProcessServerBuilder.java:151) 在org.neo4j.ogm.testutil.TestServer.startServer(TestServer.java:75) 在org.neo4j.ogm.testutil.TestServer。(TestServer.java:63) 在org.neo4j.ogm.testutil.TestServer。(TestServer.java:53) <jetty.version>9.2.9.v20150224</jetty.version>
在pom.xml上添加上述内容时,单独的测试用例通过正常,可以正常工作。但是无法构建该应用程序,并在下面显示码头错误。
[错误]项目com.example:demo:0.0.1-SNAPSHOT(C:\ code \ Springboot2.0_Neo4jOGM_Sample \ pom.xml)有1个错误 [错误]无法解析的导入POM:无法在https://repo.spring.io/milestone中找到org.eclipse.jetty:jetty-bom:pom:9.2.9.v20150224,该文件已缓存在本地存储库中,解决方法将是直到spring-milestone的更新间隔过去或强制更新@ org.springframework.boot:spring-boot-dependencies:2.0.0.RELEASE,C:\ Users \ nkumar \ .m2 \ repository \ org \后,才能重新尝试springframework \ boot \ spring-boot-dependencies \ 2.0.0.RELEASE \ spring-boot-dependencies-2.0.0.RELEASE.pom,第1652行,第25列-> [帮助2] [错误]
可以在这里看到代码示例, https://github.com/nkumarclm/springboot2.0_neo4jogm3.0/
只是想知道在使用时是否存在任何版本兼容性问题,或者是否有任何建议以带有spring和neo4j ogm版本的.cql文件运行测试?
首先十分感谢。
Jetty Internal类org.eclipse.jetty.server.SessionManager存在于Eclipse Jetty 7.0.x至9.3.x的所有版本中。
org.eclipse.jetty.server.SessionManager
http://search.maven.org/#search%7Cga%7C1%7Cfc%3A%22org.eclipse.jetty.server.SessionManager%22
该类org.eclipse.jetty.server.SessionManager已在9.4.x中删除,这是Session处理的主要版本重构的一部分。
至于…
Non-resolvable import POM: Failure to find org.eclipse.jetty:jetty-bom:pom:9.2.9.v20150224 ...
jetty-bom自从Jetty 9.3.19.v20170502起,该工件就一直存在,处于各种不良和不受支持的状态,直到在Jetty 9.4.7.v20180619中为Spring-boot用户最终对其进行了改进。
jetty-bom
让我们看一下github.com/nkumarclm/springboot2.0_neo4jogm3.0的原始依赖树
(这是原始树,没有本地指定的版本)
$ mvn dependency:tree [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building demo 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-dependency-plugin:3.0.1:tree (default-cli) @ demo --- [INFO] com.example:demo:jar:0.0.1-SNAPSHOT [INFO] +- org.springframework.boot:spring-boot-starter-data-neo4j:jar:2.0.0.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.0.0.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot:jar:2.0.0.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.0.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.0.RELEASE:compile [INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile [INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile [INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile [INFO] | | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile [INFO] | | \- org.yaml:snakeyaml:jar:1.19:runtime [INFO] | \- org.springframework.data:spring-data-neo4j:jar:5.0.5.RELEASE:compile [INFO] | +- org.springframework:spring-tx:jar:5.0.4.RELEASE:compile [INFO] | +- org.springframework:spring-context:jar:5.0.4.RELEASE:compile [INFO] | | +- org.springframework:spring-aop:jar:5.0.4.RELEASE:compile [INFO] | | \- org.springframework:spring-expression:jar:5.0.4.RELEASE:compile [INFO] | +- org.springframework:spring-beans:jar:5.0.4.RELEASE:compile [INFO] | +- org.springframework.data:spring-data-commons:jar:2.0.5.RELEASE:compile [INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.0.0.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test:jar:2.0.0.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.0.RELEASE:test [INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:test [INFO] | | \- net.minidev:json-smart:jar:2.3:test [INFO] | | \- net.minidev:accessors-smart:jar:1.2:test [INFO] | | \- org.ow2.asm:asm:jar:5.0.4:test [INFO] | +- junit:junit:jar:4.12:test [INFO] | +- org.assertj:assertj-core:jar:3.9.1:test [INFO] | +- org.mockito:mockito-core:jar:2.15.0:test [INFO] | | +- net.bytebuddy:byte-buddy:jar:1.7.10:test [INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.7.10:test [INFO] | | \- org.objenesis:objenesis:jar:2.6:test [INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test [INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test [INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test [INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test [INFO] | +- org.springframework:spring-core:jar:5.0.4.RELEASE:compile [INFO] | | \- org.springframework:spring-jcl:jar:5.0.4.RELEASE:compile [INFO] | +- org.springframework:spring-test:jar:5.0.4.RELEASE:test [INFO] | \- org.xmlunit:xmlunit-core:jar:2.5.1:test [INFO] +- org.projectlombok:lombok:jar:1.16.20:provided [INFO] +- org.codehaus.janino:janino:jar:3.0.8:compile [INFO] | \- org.codehaus.janino:commons-compiler:jar:3.0.8:compile [INFO] +- org.neo4j.driver:neo4j-java-driver:jar:1.6.1:compile [INFO] \- org.neo4j:neo4j-ogm-test:jar:3.1.0:test [INFO] +- org.neo4j:neo4j-ogm-http-driver:jar:3.1.0:test [INFO] | +- org.neo4j:neo4j-ogm-api:jar:3.1.0:compile [INFO] | | \- com.fasterxml.jackson.core:jackson-databind:jar:2.9.4:compile [INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile [INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.4:compile [INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.5:test [INFO] | \- commons-io:commons-io:jar:2.4:compile [INFO] +- org.neo4j:neo4j-ogm-core:jar:3.1.0:compile [INFO] | +- org.apache.commons:commons-lang3:jar:3.7:compile [INFO] | \- io.github.lukehutch:fast-classpath-scanner:jar:2.7.4:compile [INFO] +- org.neo4j:neo4j-ogm-embedded-driver:jar:3.1.0:test [INFO] +- org.neo4j:neo4j-ogm-bolt-driver:jar:3.1.0:compile [INFO] +- ch.qos.logback:logback-classic:jar:1.2.3:compile [INFO] | \- ch.qos.logback:logback-core:jar:1.2.3:compile [INFO] +- com.google.guava:guava:jar:21.0:test [INFO] +- org.neo4j.test:neo4j-harness:jar:3.2.9:test [INFO] | +- org.neo4j:neo4j:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-lucene-index:jar:3.2.9:test [INFO] | | | +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:test [INFO] | | | +- org.apache.lucene:lucene-core:jar:5.5.0:test [INFO] | | | +- org.apache.lucene:lucene-queryparser:jar:5.5.0:test [INFO] | | | \- org.apache.lucene:lucene-codecs:jar:5.5.0:test [INFO] | | +- org.neo4j:neo4j-graph-algo:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-udc:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-cypher:jar:3.2.9:test [INFO] | | | +- org.scala-lang:scala-library:jar:2.11.12:test [INFO] | | | +- org.scala-lang:scala-reflect:jar:2.11.12:test [INFO] | | | +- org.neo4j:neo4j-graph-matching:jar:3.1.3:test [INFO] | | | +- org.neo4j:neo4j-codegen:jar:3.2.9:test [INFO] | | | +- org.neo4j:neo4j-cypher-compiler-2.3:jar:2.3.11:test [INFO] | | | | +- org.neo4j:neo4j-cypher-frontend-2.3:jar:2.3.11:test [INFO] | | | | \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.4.2:test [INFO] | | | +- org.neo4j:neo4j-cypher-compiler-3.1:jar:3.1.6:test [INFO] | | | | +- org.neo4j:neo4j-cypher-frontend-3.1:jar:3.1.6:test [INFO] | | | | \- com.github.ben-manes.caffeine:caffeine:jar:2.6.2:test [INFO] | | | +- org.neo4j:neo4j-cypher-compiler-3.2:jar:3.2.9:test [INFO] | | | | +- org.neo4j:neo4j-cypher-frontend-3.2:jar:3.2.9:test [INFO] | | | | \- org.neo4j:neo4j-cypher-ir-3.2:jar:3.2.9:test [INFO] | | | +- org.parboiled:parboiled-scala_2.11:jar:1.1.7:test [INFO] | | | | \- org.parboiled:parboiled-core:jar:1.1.7:test [INFO] | | | \- net.sf.opencsv:opencsv:jar:2.3:test [INFO] | | +- org.neo4j:neo4j-jmx:jar:3.2.9:test [INFO] | | \- org.neo4j:neo4j-consistency-check:jar:3.2.9:test [INFO] | +- org.neo4j.app:neo4j-server:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j:pom:3.2.9:test [INFO] | | +- org.neo4j:neo4j-security:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-dbms:jar:3.2.9:test [INFO] | | | +- org.neo4j:neo4j-import-tool:jar:3.2.9:test [INFO] | | | \- org.apache.commons:commons-compress:jar:1.12:test [INFO] | | +- org.neo4j:neo4j-command-line:jar:3.2.9:test [INFO] | | +- org.neo4j:server-api:jar:3.2.9:test [INFO] | | | \- org.neo4j.3rdparty.javax.ws.rs:jsr311-api:jar:1.1.2.r612:test [INFO] | | +- org.neo4j:neo4j-bolt:jar:3.2.9:test [INFO] | | | \- io.netty:netty-all:jar:4.1.22.Final:test [INFO] | | +- org.neo4j.client:neo4j-browser:jar:3.1.4:test [INFO] | | +- org.neo4j:neo4j-shell:jar:3.2.9:test [INFO] | | | \- jline:jline:jar:2.12:test [INFO] | | +- org.eclipse.jetty:jetty-server:jar:9.4.8.v20171121:test [INFO] | | | +- javax.servlet:javax.servlet-api:jar:3.1.0:test [INFO] | | | +- org.eclipse.jetty:jetty-http:jar:9.4.8.v20171121:test [INFO] | | | | \- org.eclipse.jetty:jetty-util:jar:9.4.8.v20171121:test [INFO] | | | \- org.eclipse.jetty:jetty-io:jar:9.4.8.v20171121:test [INFO] | | +- org.eclipse.jetty:jetty-webapp:jar:9.4.8.v20171121:test [INFO] | | | +- org.eclipse.jetty:jetty-xml:jar:9.4.8.v20171121:test [INFO] | | | \- org.eclipse.jetty:jetty-servlet:jar:9.4.8.v20171121:test [INFO] | | | \- org.eclipse.jetty:jetty-security:jar:9.4.8.v20171121:test [INFO] | | +- com.sun.jersey:jersey-server:jar:1.19:test [INFO] | | +- com.sun.jersey:jersey-servlet:jar:1.19:test [INFO] | | +- commons-configuration:commons-configuration:jar:1.10:test [INFO] | | | +- commons-lang:commons-lang:jar:2.6:test [INFO] | | | \- commons-logging:commons-logging:jar:1.1.1:test [INFO] | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:test [INFO] | | | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:test [INFO] | | | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:test [INFO] | | +- org.mozilla:rhino:jar:1.7R4:test [INFO] | | +- org.bouncycastle:bcprov-jdk15on:jar:1.53:test [INFO] | | +- org.bouncycastle:bcpkix-jdk15on:jar:1.53:test [INFO] | | \- com.sun.jersey.contribs:jersey-multipart:jar:1.19:test [INFO] | | \- org.jvnet.mimepull:mimepull:jar:1.9.3:test [INFO] | +- org.neo4j:neo4j-common:test-jar:tests:3.2.9:test [INFO] | +- org.neo4j:neo4j-kernel:test-jar:tests:3.2.9:test [INFO] | | +- org.neo4j:neo4j-graphdb-api:jar:3.2.9:test [INFO] | | | \- org.neo4j:neo4j-resource:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-common:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-collections:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-primitive-collections:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-io:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-csv:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-logging:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-lucene-upgrade:jar:3.2.9:test [INFO] | | | \- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:test [INFO] | | +- org.neo4j:neo4j-configuration:jar:3.2.9:test [INFO] | | +- org.neo4j:neo4j-index:jar:3.2.9:test [INFO] | | \- org.neo4j:neo4j-ssl:jar:3.2.9:test [INFO] | +- org.neo4j:neo4j-io:test-jar:tests:3.2.9:test [INFO] | | \- org.neo4j:neo4j-unsafe:jar:3.2.9:test [INFO] | +- com.sun.jersey:jersey-client:jar:1.19:test [INFO] | | \- com.sun.jersey:jersey-core:jar:1.19:test [INFO] | +- org.neo4j.app:neo4j-server:test-jar:tests:3.2.9:test [INFO] | +- commons-codec:commons-codec:jar:1.11:compile [INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.9:test [INFO] | \- org.neo4j:neo4j-kernel:jar:3.2.9:test [INFO] \- org.slf4j:jcl-over-slf4j:jar:1.7.25:test [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.939 s [INFO] Finished at: 2018-07-03T12:58:10Z [INFO] Final Memory: 26M/88M [INFO] ------------------------------------------------------------------------
从这里我们得知父母org.springframework.boot:spring-boot-starter- parent:2.0.0.RELEASE对…有要求org.eclipse.jetty:jetty- server:jar:9.4.8.v20171121。
org.springframework.boot:spring-boot-starter- parent:2.0.0.RELEASE
org.eclipse.jetty:jetty- server:jar:9.4.8.v20171121
注意:Jetty版本控制(自1995年起)是 <servlet_support>.<major_version>.<minor_version>
<servlet_support>.<major_version>.<minor_version>
所以你有了:
那是不兼容的。
项目github.com/nkumarclm/springboot2.0_neo4jogm3.0无法以其定义/配置的方式运行。似乎应该升级neo4jogm以支持Jetty 9.4.x,或者应该将spring-boot降级以支持Jetty9.2.x。
简而言之,您有一个更大的问题,那就是选择正确版本的Jetty。