2014-01-29 51 views
0

在WebSphere Liberty中向我的REST服務發佈JSON郵件時,遇到以下問題。在我的WAR中包含Apache Wink客戶端時,不支持的媒體類型問題

This 只發生當我捆綁我的WAR中的Apache Wink客戶端罐子。

[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> 

自由版本:

WebSphere Application Server 8.5.5.1 (wlp-1.0.4.cl50120131011-1639) 

有沒有辦法來解決這個問題?

固定

繼安東的鏈接下面我改變了我的wink-client依賴範圍<scope>provided</scope>並添加以下到WAS自由server.xml

<application location="C:\myproject\target\myapp.war" type="war"> 
    <classloader apiTypeVisibility="spec,ibm-api,api,third-party"/> 
</application> 

回答