AbstractMethodError: org.jboss.resteasy.specimpl.ResponseBuilderImpl misses 'javax.ws.rs.core.Response$ResponseBuilder status(int, java.lang.String)'
AbstractMethodError: org.jboss.resteasy.specimpl.ResponseBuilderImpl misses 'javax.ws.rs.core.Response$ResponseBuilder status(int, java.lang.String)'
我在 Tomcat 上尝试部署 Okapi Longhorn 时出现此错误:
FATAL [http-nio-8080-exec-1] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Resteasy] in context with path [/okapi-longhorn] threw exception [Servlet execution threw an exception] with root cause
java.lang.AbstractMethodError: Receiver class org.jboss.resteasy.specimpl.ResponseBuilderImpl does not define or inherit an implementation of the resolved method 'abstract javax.ws.rs.core.Response$ResponseBuilder status(int, java.lang.String)' of abstract class javax.ws.rs.core.Response$ResponseBuilder.
at javax.ws.rs.core.Response$ResponseBuilder.status(Response.java:896)
完整堆栈跟踪:
java.lang.AbstractMethodError: Receiver class org.jboss.resteasy.specimpl.ResponseBuilderImpl
does not define or inherit an implementation of the resolved method
'abstract javax.ws.rs.core.Response$ResponseBuilder status(int, java.lang.String)'
of abstract class javax.ws.rs.core.Response$ResponseBuilder.
at javax.ws.rs.core.Response$ResponseBuilder.status(Response.java:896)
at javax.ws.rs.core.Response.status(Response.java:567)
at javax.ws.rs.core.Response.status(Response.java:578)
at javax.ws.rs.core.Response.ok(Response.java:613)
at javax.ws.rs.core.Response.ok(Response.java:625)
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:283)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:367)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:639)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:881)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1647)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
我尝试了不同的 Java 和 Tomcat 版本以及不同的架构(M1 上的 arm64e 和 x86_64)但没有成功。
我猜有些依赖缺失或冲突,有些是关于 RESTEasy 的,所以我把它们包括在这里:
Saxon-HE-10.3.jar
Saxon-HE-9.8.0-12.jar
activation-1.1.jar
annotations-15.0.jar
ant-1.6.5.jar
apache-mime4j-0.6.jar
axis-1.4.jar
axis-jaxrpc-1.4.jar
axis-saaj-1.4.jar
axis-wsdl4j-1.5.1.jar
build-logback-0.37-SNAPSHOT.jar
checker-compat-qual-2.5.5.jar
color-loggers-1.0.5.jar
common-io-3.3.2.jar
common-io-3.6.2.jar
common-lang-3.3.2.jar
common-lang-3.6.2.jar
commons-codec-1.2.jar
commons-codec-1.6.jar
commons-csv-1.5.jar
commons-csv-1.8.jar
commons-discovery-0.5.jar
commons-exec-1.3.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-io-2.5.jar
commons-lang-2.6.jar
commons-logging-1.2.jar
core-3.1.1.jar
dtdparser-1.21.jar
error_prone_annotations-2.3.4.jar
failureaccess-1.0.1.jar
fontbox-2.0.12.jar
fontbox-2.0.24.jar
grpc-context-1.22.1.jar
gson-2.8.6.jar
guava-20.0.jar
guava-30.1-android.jar
h2-1.3.170.jar
h2-1.4.199.jar
hamcrest-core-1.1.jar
htmlparser-1.4.jar
httpclient-4.1.2.jar
httpclient-4.2.6.jar
httpcore-4.4.10.jar
httpcore-4.4.14.jar
httpmime-4.2.6.jar
httpmime-4.5.6.jar
icu4j-62.1.jar
icu4j-68.2.jar
istack-commons-runtime-3.0.10.jar
j2objc-annotations-1.1.jar
j2objc-annotations-1.3.jar
jackson-annotations-2.12.1.jar
jackson-core-2.12.1.jar
jackson-core-2.9.6.jar
jackson-databind-2.12.1.jar
jakarta.activation-1.2.1.jar
jakarta.mail-1.6.5.jar
jakarta.validation-api-2.0.2.jar
jansi-1.13.jar
java-diff-1.1.2.jar
java-uuid-generator-3.1.3.jar
java-uuid-generator-4.0.jar
javacc-7.0.3.jar
javassist-3.12.1.GA.jar
javax.activation-api-1.2.0.jar
jaxb-api-2.2.3.jar
jaxb-api-2.3.1.jar
jaxb-core-2.3.0.1.jar
jaxb-impl-2.2.4.jar
jaxb-impl-2.3.2.jar
jaxb-runtime-2.3.3-b02.jar
jaxrs-api-2.3.5.Final.jar
jboss-annotations-api_1.3_spec-2.0.1.Final.jar
jboss-jaxb-api_2.3_spec-2.0.0.Final.jar
jboss-jaxrs-api_2.1_spec-2.0.1.Final.jar
jboss-logging-3.3.2.Final.jar
jcip-annotations-1.0-1.jar
jcip-annotations-1.0.jar
jcl-over-slf4j-1.7.25.jar
jcl-over-slf4j-1.7.30.jar
jericho-html-3.4.jar
jettison-1.3.1.jar
jettison-1.4.0.jar
jetty-util-6.0.0.jar
json-simple-1.1.1.jar
jsp-2.1-6.0.0.jar
jsp-api-2.1-6.0.0.jar
jsr250-api-1.0.jar
jsr305-3.0.2.jar
junit-4.10.jar
listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
log4j-1.2.13.jar
logback-classic-1.2.3.jar
logback-core-1.2.3.jar
longhorn-js-client-1.1.4.jar
lucene-analyzers-common-8.8.0.jar
lucene-core-3.3.0.jar
lucene-core-8.8.0.jar
lucene-queries-8.8.0.jar
mail-1.4.4.jar
opencensus-api-0.24.0.jar
opencensus-contrib-http-util-0.24.0.jar
pdfbox-2.0.12.jar
pdfbox-2.0.24.jar
reactive-streams-1.0.3.jar
resteasy-client-3.12.0.Final.jar
resteasy-jaxb-provider-2.3.5.Final.jar
resteasy-jaxb-provider-3.12.0.Final.jar
resteasy-jaxrs-2.3.5.Final.jar
resteasy-jaxrs-3.12.0.Final.jar
resteasy-jettison-provider-2.3.5.Final.jar
resteasy-jettison-provider-3.12.0.Final.jar
resteasy-multipart-provider-2.3.5.Final.jar
resteasy-multipart-provider-3.12.0.Final.jar
scannotation-1.0.3.jar
servlet-api-2.5-6.0.0.jar
servlet-api-2.5.jar
slf4j-api-1.7.25.jar
slf4j-api-1.7.30.jar
snakeyaml-1.21.jar
snakeyaml-1.27.jar
stax-api-1.0-2.jar
stax2-api-4.1.jar
stax2-api-4.2.1.jar
trove4j-3.0.3.jar
txw2-2.3.3-b02.jar
woodstox-core-5.1.0.jar
woodstox-core-6.2.3.jar
我该如何解决这个问题?
v1.42 似乎是一个拙劣的版本,其中包含许多相互冲突、过时的库。与此同时,v1.43 released 有效(尽管是 4 月 1 日)。
okapi-longhorn_all-platforms_1.41.0.zip 2021-04-10 04:21 53M
okapi-longhorn_all-platforms_1.42.0.zip 2021-12-23 12:27 96M
okapi-longhorn_all-platforms_1.43.0.zip 2022-04-01 22:40 58M
我会将其设为社区 Wiki post 以防有人对使用 JPDA 调试器 运行 tomcat 感到困惑并进一步检查原因。
我在 Tomcat 上尝试部署 Okapi Longhorn 时出现此错误:
FATAL [http-nio-8080-exec-1] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Resteasy] in context with path [/okapi-longhorn] threw exception [Servlet execution threw an exception] with root cause
java.lang.AbstractMethodError: Receiver class org.jboss.resteasy.specimpl.ResponseBuilderImpl does not define or inherit an implementation of the resolved method 'abstract javax.ws.rs.core.Response$ResponseBuilder status(int, java.lang.String)' of abstract class javax.ws.rs.core.Response$ResponseBuilder.
at javax.ws.rs.core.Response$ResponseBuilder.status(Response.java:896)
完整堆栈跟踪:
java.lang.AbstractMethodError: Receiver class org.jboss.resteasy.specimpl.ResponseBuilderImpl
does not define or inherit an implementation of the resolved method
'abstract javax.ws.rs.core.Response$ResponseBuilder status(int, java.lang.String)'
of abstract class javax.ws.rs.core.Response$ResponseBuilder.
at javax.ws.rs.core.Response$ResponseBuilder.status(Response.java:896)
at javax.ws.rs.core.Response.status(Response.java:567)
at javax.ws.rs.core.Response.status(Response.java:578)
at javax.ws.rs.core.Response.ok(Response.java:613)
at javax.ws.rs.core.Response.ok(Response.java:625)
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:283)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:367)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:639)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:881)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1647)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
我尝试了不同的 Java 和 Tomcat 版本以及不同的架构(M1 上的 arm64e 和 x86_64)但没有成功。
我猜有些依赖缺失或冲突,有些是关于 RESTEasy 的,所以我把它们包括在这里:
Saxon-HE-10.3.jar
Saxon-HE-9.8.0-12.jar
activation-1.1.jar
annotations-15.0.jar
ant-1.6.5.jar
apache-mime4j-0.6.jar
axis-1.4.jar
axis-jaxrpc-1.4.jar
axis-saaj-1.4.jar
axis-wsdl4j-1.5.1.jar
build-logback-0.37-SNAPSHOT.jar
checker-compat-qual-2.5.5.jar
color-loggers-1.0.5.jar
common-io-3.3.2.jar
common-io-3.6.2.jar
common-lang-3.3.2.jar
common-lang-3.6.2.jar
commons-codec-1.2.jar
commons-codec-1.6.jar
commons-csv-1.5.jar
commons-csv-1.8.jar
commons-discovery-0.5.jar
commons-exec-1.3.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-io-2.5.jar
commons-lang-2.6.jar
commons-logging-1.2.jar
core-3.1.1.jar
dtdparser-1.21.jar
error_prone_annotations-2.3.4.jar
failureaccess-1.0.1.jar
fontbox-2.0.12.jar
fontbox-2.0.24.jar
grpc-context-1.22.1.jar
gson-2.8.6.jar
guava-20.0.jar
guava-30.1-android.jar
h2-1.3.170.jar
h2-1.4.199.jar
hamcrest-core-1.1.jar
htmlparser-1.4.jar
httpclient-4.1.2.jar
httpclient-4.2.6.jar
httpcore-4.4.10.jar
httpcore-4.4.14.jar
httpmime-4.2.6.jar
httpmime-4.5.6.jar
icu4j-62.1.jar
icu4j-68.2.jar
istack-commons-runtime-3.0.10.jar
j2objc-annotations-1.1.jar
j2objc-annotations-1.3.jar
jackson-annotations-2.12.1.jar
jackson-core-2.12.1.jar
jackson-core-2.9.6.jar
jackson-databind-2.12.1.jar
jakarta.activation-1.2.1.jar
jakarta.mail-1.6.5.jar
jakarta.validation-api-2.0.2.jar
jansi-1.13.jar
java-diff-1.1.2.jar
java-uuid-generator-3.1.3.jar
java-uuid-generator-4.0.jar
javacc-7.0.3.jar
javassist-3.12.1.GA.jar
javax.activation-api-1.2.0.jar
jaxb-api-2.2.3.jar
jaxb-api-2.3.1.jar
jaxb-core-2.3.0.1.jar
jaxb-impl-2.2.4.jar
jaxb-impl-2.3.2.jar
jaxb-runtime-2.3.3-b02.jar
jaxrs-api-2.3.5.Final.jar
jboss-annotations-api_1.3_spec-2.0.1.Final.jar
jboss-jaxb-api_2.3_spec-2.0.0.Final.jar
jboss-jaxrs-api_2.1_spec-2.0.1.Final.jar
jboss-logging-3.3.2.Final.jar
jcip-annotations-1.0-1.jar
jcip-annotations-1.0.jar
jcl-over-slf4j-1.7.25.jar
jcl-over-slf4j-1.7.30.jar
jericho-html-3.4.jar
jettison-1.3.1.jar
jettison-1.4.0.jar
jetty-util-6.0.0.jar
json-simple-1.1.1.jar
jsp-2.1-6.0.0.jar
jsp-api-2.1-6.0.0.jar
jsr250-api-1.0.jar
jsr305-3.0.2.jar
junit-4.10.jar
listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
log4j-1.2.13.jar
logback-classic-1.2.3.jar
logback-core-1.2.3.jar
longhorn-js-client-1.1.4.jar
lucene-analyzers-common-8.8.0.jar
lucene-core-3.3.0.jar
lucene-core-8.8.0.jar
lucene-queries-8.8.0.jar
mail-1.4.4.jar
opencensus-api-0.24.0.jar
opencensus-contrib-http-util-0.24.0.jar
pdfbox-2.0.12.jar
pdfbox-2.0.24.jar
reactive-streams-1.0.3.jar
resteasy-client-3.12.0.Final.jar
resteasy-jaxb-provider-2.3.5.Final.jar
resteasy-jaxb-provider-3.12.0.Final.jar
resteasy-jaxrs-2.3.5.Final.jar
resteasy-jaxrs-3.12.0.Final.jar
resteasy-jettison-provider-2.3.5.Final.jar
resteasy-jettison-provider-3.12.0.Final.jar
resteasy-multipart-provider-2.3.5.Final.jar
resteasy-multipart-provider-3.12.0.Final.jar
scannotation-1.0.3.jar
servlet-api-2.5-6.0.0.jar
servlet-api-2.5.jar
slf4j-api-1.7.25.jar
slf4j-api-1.7.30.jar
snakeyaml-1.21.jar
snakeyaml-1.27.jar
stax-api-1.0-2.jar
stax2-api-4.1.jar
stax2-api-4.2.1.jar
trove4j-3.0.3.jar
txw2-2.3.3-b02.jar
woodstox-core-5.1.0.jar
woodstox-core-6.2.3.jar
我该如何解决这个问题?
v1.42 似乎是一个拙劣的版本,其中包含许多相互冲突、过时的库。与此同时,v1.43 released 有效(尽管是 4 月 1 日)。
okapi-longhorn_all-platforms_1.41.0.zip 2021-04-10 04:21 53M
okapi-longhorn_all-platforms_1.42.0.zip 2021-12-23 12:27 96M
okapi-longhorn_all-platforms_1.43.0.zip 2022-04-01 22:40 58M
我会将其设为社区 Wiki post 以防有人对使用 JPDA 调试器 运行 tomcat 感到困惑并进一步检查原因。