0

WebSphere Liberty の REST サービスに JSON メッセージを POST すると、次の問題が発生します。

これは、WAR 内に Apache Wink Client 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>

リバティバージョン:

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

1 に答える 1

1

開発者ワークス ポータルで関連する投稿を見つけました。それは役立つかもしれません。

デベロッパーワークス フォーラム

于 2014-01-29T19:29:21.027 に答える