在向WebSphere Liberty中的REST服务发布JSON消息时,我遇到了以下问题。
当我在我的WAR中捆绑Apache Wink客户端jar时,仅发生。
[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
我正在添加的依赖项:
<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版本:
WebSphere Application Server 8.5.5.1 (wlp-1.0.4.cl50120131011-1639)
有没有办法解决这个问题?
按照下面的Anton链接,我将wink-client
依赖范围更改为<scope>provided</scope>
,并将以下内容添加到WAS Liberty server.xml
中:
<application location="C:\myproject\target\myapp.war" type="war">
<classloader apiTypeVisibility="spec,ibm-api,api,third-party"/>
</application>