I'm trying to upgrade spring boot from 1.5 to 2.0 and facing issue with jetty version. I'm new to neo4j ogm and spring boot.
When I try to run a test case it fails with below error.
java.lang.NoClassDefFoundError: org/eclipse/jetty/server/SessionManager at org.neo4j.server.CommunityNeoServer.createWebServer(CommunityNeoServer.java:90) at org.neo4j.server.AbstractNeoServer.init(AbstractNeoServer.java:188) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:204) at org.neo4j.harness.internal.InProcessServerControls.start(InProcessServerControls.java:71) at org.neo4j.harness.internal.AbstractInProcessServerBuilder.newServer(AbstractInProcessServerBuilder.java:151) at org.neo4j.ogm.testutil.TestServer.startServer(TestServer.java:75) at org.neo4j.ogm.testutil.TestServer.(TestServer.java:63) at org.neo4j.ogm.testutil.TestServer.(TestServer.java:53)
and tried simply adding jetty.version referred here in this issue, Spring boot integration test fails with Neo4j.
<jetty.version>9.2.9.v20150224</jetty.version>
while adding the above on pom.xml, test case alone passing fine which is working as expected. But unable to build the app and ends up with jetty error below.
[ERROR] The project com.example:demo:0.0.1-SNAPSHOT (C:\code\Springboot2.0_Neo4jOGM_Sample\pom.xml) has 1 error [ERROR] Non-resolvable import POM: Failure to find org.eclipse.jetty:jetty-bom:pom:9.2.9.v20150224 in https://repo.spring.io/milestone was cached in the local repository, resolution will not be reattempted until the update interval of spring-milestone has elapsed or updates are forced @ 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, line 1652, column 25 -> [Help 2] [ERROR]
And the code sample can be seen here, https://github.com/nkumarclm/springboot2.0_neo4jogm3.0/
Just would like to know if there are any version compatibility problem on using or any suggestion to run tests with .cql file with provided spring & neo4j ogm versions?
Thanks very much in advance.
I tried reaching Neo4j team and here is the response I received.
The root problem is the dependency mismatch between SpringBoot and Neo4j on jetty. The problem occurs because you are using the
MultiDriverTestClass
from the neo4j-ogm-test module. It will spawn a Neo4j instance that will take request over the given transport mode defined via the protocol you defined in yourogm.properties
file. If you would alter your test base to an embedded instance, you could work around the problem: Remove theMultiDriverTestClass
inheritance and create aConfiguration
on your own likeConfiguration configuration = new Configuration.Builder(new ClasspathConfigurationSource("ogm.properties")).build();
. The content of theogm.properties
should be empty to force OGM to create a new temporary embedded instance.The Jetty Internal class
org.eclipse.jetty.server.SessionManager
, existed for all versions of Eclipse Jetty 7.0.x thru 9.3.x.http://search.maven.org/#search%7Cga%7C1%7Cfc%3A%22org.eclipse.jetty.server.SessionManager%22
The class
org.eclipse.jetty.server.SessionManager
was removed in 9.4.x as part of that major version refactor of Session handling.As for ...
The
jetty-bom
artifact, as a concept, has existed since Jetty 9.3.19.v20170502, in various bad and unsupported states until it was finally improved at Jetty 9.4.7.v20180619 for the users of spring-boot.Lets look at the raw dependency tree for github.com/nkumarclm/springboot2.0_neo4jogm3.0
(This is the raw tree, without locally specified versions)
From here we learn that the parent
org.springframework.boot:spring-boot-starter-parent:2.0.0.RELEASE
has a requirement fororg.eclipse.jetty:jetty-server:jar:9.4.8.v20171121
.So you have:
That's just incompatible.
The project github.com/nkumarclm/springboot2.0_neo4jogm3.0 cannot function the way its defined / configured. It would seem that either neo4jogm should be upgraded to support Jetty 9.4.x, or spring-boot should be downgraded to support Jetty 9.2.x.
In short, you have a bigger issue then merely picking the right version of Jetty.