jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.86k stars 1.91k forks source link

IllegalAccessError: class org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine #12275

Closed johmn123-wq closed 2 months ago

johmn123-wq commented 2 months ago

Jetty version(s)

Migration from Jetty 11.0.x to Jetty 12.0.x

Jetty Environment

Applicable for jetty-12

Java version/vendor (use: java -version) Java17

OS type/version

Description

IllegalAccessError: class org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine - https://issues.apache.org/jira/browse/CXF-9034 Can you please provide the expected timeline of org.apache.cxf:cxf-rt-transports-http-jetty for 4.1.0 version release which is compatible with jetty12

sbordet commented 2 months ago

@johmn123-wq this seems to be an Apache CXF issue, not a Jetty issue. We cannot provide timelines for other projects.

joakime commented 2 months ago

Reported stacktrace (against CXF 4.0.4, Jetty 12.0.10, and org.springframework:spring-websocket:jar:6.0.17)

java.lang.IllegalAccessError: class org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine tried to access protected method 'void org.eclipse.jetty.server.Handler$AbstractContainer.<init>()' (org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine and org.eclipse.jetty.server.Handler$AbstractContainer are in unnamed module of loader 'app')
    at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.initializeContexts(JettyHTTPServerEngine.java:596)
    at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:397)
    at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:184)
    at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:53)
    at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)
    at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:894)
    at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:130)
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:364)
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:130)
    at jakarta.xml.ws.Endpoint.publish(Endpoint.java:224)
    at com.seagullsw.appinterface.server.backend.soap.LS38925ClientOperationsTest.beforeClass(LS38925ClientOperationsTest.java:91)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:757)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

The line in CXF 4.0.4 is ...

https://github.com/apache/cxf/blob/cxf-4.0.4/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java#L596

ContextHandlerCollection, and basically any other feature of Jetty 11.x core that uses Servlet does not exist in Jetty 12, which has no core level Servlet dependency.