I'm hitting the following issue when doing a POSTing a JSON message to my REST service in WebSphere Liberty.
This ONLY happens when I bundle the Apache Wink Client jars inside my WAR.
[29/01/14 18:52:57:634 GMT] 00000027 org.apache.wink.server.internal.RequestProcessor I The following error occurred during the invocation of the handlers chain: WebApplicationException (415 - Unsupported Media Type) with message 'null' while processing POST request sent to http://host:9080/my-war/myrest/req
The dependencies I'm adding:
<dependency>
<groupId>org.apache.wink</groupId>
<artifactId>wink-client</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.wink</groupId>
<artifactId>wink-client-apache-httpclient</artifactId>
<version>1.4</version>
</dependency>
Liberty version:
WebSphere Application Server 8.5.5.1 (wlp-1.0.4.cl50120131011-1639)
Is there a way to work around this issue?
Following Anton's link below I changed my wink-client
dependency scope to <scope>provided</scope>
and added the following to the WAS Liberty server.xml
:
<application location="C:\myproject\target\myapp.war" type="war">
<classloader apiTypeVisibility="spec,ibm-api,api,third-party"/>
</application>
I've found related post on developer works portal. It might help.