Jersey on WebSphere issue

I was just starting creating Jersey RESTful services on WebSphere 8.5 and came across an error.

[3/31/15 14:27:01:231 IST] 00000065 webapp        E logServletError SRVE0293E: [Servlet Error]-[app.FirstRestApplication]: java.lang.NullPointerException
at org.apache.wink.common.internal.http.Accept.valueOf(
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptHeader(
at org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptableMediaTypes(

The issue arises out of the fact that WebSphere ships with Apache Wink as default implementation of JAX-RS and your application picks up Wink from the class path instead of routing to Jersey causing this unexpected behavior.

The solution

Just apply Fix Pack 4 (or 5) and you’re done which detects the applications shipping with other JAX-RS implementations and allows it. A link to IBM note on this is

Leave a Reply

Your email address will not be published. Required fields are marked *