legacy-knowledge-base
公開されました Jul. 2, 2025

Unable to deserialize object というエラーで一部のフォーム ページがコンテンツの表示に失敗する

written-by

Rafael Regner

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

問題

  • カスタム ポートレットが関連付けられているフォーム ページを表示しようとすると、ページはフォームのレンダリングに失敗しました。
  • ポータル ログに次のエラーが表示されます。
2021-01-26 00:04:23.021 ERROR [ajp-nio-127.0.0.1-8009-exec-227][JSONWebServiceServiceAction:126] Unable to deserialize object
2021-01-26 00:05:23.101 ERROR [ajp-nio-127.0.0.1-8009-exec-268][JSONWebServiceServiceAction:126] com.mchange.v2.c3p0.WrapperConnectionPoolDataSource is not allowed to be instantiated

Environment

  • Liferay DXP 7.0 フィックスパック 65+
  • Liferay DXP 7.1 フィックスパック 4+
  • Liferay DXP 7.2

解決策

  • この動作は、 LSV-412 脆弱性の修正によるものです。
  • ポータル プロパティ json.deserialization.whitelist.class.names が追加され、JSON リクエストからデシリアライズできるクラスを制御できるようになりました。

  • JSON リクエストからの逆シリアル化を許可するカスタム クラスがある場合は、次のようにプロパティに追加してください。
    #
    # Input a list of comma delimited class names that can be deserialized using
    # JSONFactory.
    #
    # Env: LIFERAY_JSON_PERIOD_DESERIALIZATION_PERIOD_WHITELIST_PERIOD_CLASS_PERIOD_NAMES
    #
    json.deserialization.whitelist.class.names=\
        com.liferay.portal.kernel.cal.DayAndPosition,\
        com.liferay.portal.kernel.cal.Duration,\
        com.liferay.portal.kernel.cal.TZSRecurrence,\
        com.liferay.portal.kernel.messaging.Message,\
        com.liferay.portal.kernel.model.PortletPreferencesIds,\
        com.liferay.portal.kernel.security.auth.HttpPrincipal,\
        com.liferay.portal.kernel.service.permission.ModelPermissions,\
        com.liferay.portal.kernel.service.ServiceContext,\
        com.liferay.portal.kernel.util.LongWrapper,\
        com.liferay.portlet.messageboards.messaging.MailingListRequest,\
        java.util.GregorianCalendar,\
        java.util.Locale,\
        java.util.TimeZone,\
        sun.util.calendar.ZoneInfo,\
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource
did-this-article-resolve-your-issue

legacy-knowledge-base