tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Kaplan <tie...@gmail.com>
Subject java.lang.ClassNotFoundException: javax.ws.rs.MessageProcessingException
Date Fri, 09 Jan 2015 21:37:06 GMT
Source of question:
http://stackoverflow.com/questions/27868936/java-lang-classnotfoundexception-javax-ws-rs-messageprocessingexception

I am deploying a war to Tomcat 7.0.57.  This code uses Jersey 2.x Client to
communicate with a Rest endpoint and exposes its own Rest endpoints using
CXF (AKA the war's endpoint).

When I hit one of the war's endpoints, the code seems to work and returns a
response without issue from the server's perspective, but the client gets a
500 response returned to it from tomcat.  This is the error:

    java.lang.ClassNotFoundException: javax.ws.rs.MessageProcessingException

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)

org.apache.cxf.jaxrs.impl.ResponseBuilderImpl.build(ResponseBuilderImpl.java:69)

org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:137)

org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:86)

org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)

org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)

org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)

org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)

org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)

org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)

org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)

org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:167)

org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)

org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:646)

org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Oddly enough, this error doesn't show up in the tomcat log.

I did a little research and it seems that this class is part of jax-rs.  In
my maven pom, I'm already including this dependency:

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>

But this dependency doesn't seem to have this class.  That class *is* in
this dependency though:

        <dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0-m01</version>
</dependency>

I feel uncomfortable downgrading to a lower version that's a milestone
though.  More importantly, that jar does not include classes I'm using in
my code like `javax.ws.rs.client.ClientBuilder`.

Can anyone explain why I'm getting this exception and how to resolve this
issue?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message