Reputation: 712
I am deploying my JPA project to wildfly 8.2 server. its giving me exception
Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/ext/ExceptionMapper
Can someone put some light on it..
i have created Provider
@Provider
public class EJBExceptionMapper implements ExceptionMapper<Exception>
{
public Response toResponse(Exception exception) {
return Response.status(500).build();
}
}
But still the error is there.
Upvotes: 1
Views: 1524
Reputation: 712
I was using WildFly 8.2.0 with EclipseLink 2.5.2
That's why it was causing..
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.ext.ExceptionMapper from [Module "org.eclipse.persistence:main"
To solve this line
<module name="javax.ws.rs.api"/>
needs to be included in Wildfly installation modules/system/layers/base/org/eclipse/persistence/main/module.xml file..
This solved the problem for me..
https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide#JPAReferenceGuide-UsingEclipseLink
Upvotes: 3
Reputation:
check this below link may be will helpful for you:
http://howtodoinjava.com/2013/06/03/exception-handling-in-jax-rs-resteasy-with-exceptionmapper/
Upvotes: 0