'AbstractMethodError: org.jboss.resteasy.specimpl.ResponseBuilderImpl misses 'javax.ws.rs.core.Response$ResponseBuilder status(int, java.lang.String)'

I was trying to deploy Okapi Longhorn on Tomcat when I got this error:

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)

Full stack trace:

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)

I tried different Java and Tomcat versions also different architectures (arm64e and x86_64 on M1) without success.

I guess some dependency is missing or conflicting, something concerning RESTEasy, so I include them here:

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

How can I fix this?



Solution 1:[1]

It seems v1.42 was a botched release with many conflicting, outdated libraries included. In the meantime v1.43 was released which works (despite April 1st).

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

I'll make this a community wiki post in case someone feels bemused to run tomcat with JPDA debugger and further examine the cause.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1