legacy-knowledge-base
公開されました Sep. 10, 2025

Liferay REST API を介して JSON オブジェクトを取得しても、7.2 では機能しなくなりました

written-by

Alfonso Crisci

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • 以前のバージョンから Liferay DXP 7.2 に移行した後、お客様は、 JAX-RS チュートリアルに従ってポータルに実装され、JSON オブジェクトを取得することを目的とした REST API が返されることに気付く場合があります。

    No message body writer has been found for class , ContentType: application/json
    次のようなオブジェクトの代わりに:

    {"name":"Tom","department":"HR"}

Environment

  • Liferay DXP 7.2

解決策

  1. サーバーを停止し、 osgi/state フォルダーと tomcat/work および /temp フォルダーのコンテンツをクリーンアップします。

  2. osgi/configs フォルダー内の org.apache.aries.jax.rs.jackson.config ファイルを見つけます。

  3. 以下の行が のみ になるように内容を変更します。

    osgi.jaxrs.application.select="(&(!(jackson.disabled=true))(osgi.jaxrs.name=*))"
  4. サーバーを再起動します

追加情報

  • 上記の手順は、 LPS-90412 で実装され、 LPS-96061 (Liferay DXP 7.2 Fix Pack 1 でリリース) の回帰バグによってリリースされた変更を考慮して必要です。

did-this-article-resolve-your-issue

legacy-knowledge-base