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

Elasticsearch 7 使用時の ClassCastException

written-by

Michael Warren Young

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

問題

  • Elasticsearch 7 プラグインをインストールし、Liferay DXP を Elasticsearch 7 サーバーに接続すると、起動時に次のようなエラーがスローされます。

    ERROR [liferay/scheduler_dispatch-4][ElasticsearchIndexSearcher:169] java.lang.ClassCastException: org.elasticsearch.search.sort.FieldSortBuilder cannot be cast to org.elasticsearch.search.sort.SortBuilder

    java.lang.ClassCastException: org.elasticsearch.search.sort.FieldSortBuilder cannot be cast to org.elasticsearch.search.sort.SortBuilder

Environment

  • Liferay DXP 7.2 (フィックスパック DXP-2+ を使用)
  • Elasticsearch 7

解決策

  • Elasticsearch プラグインの複数のバージョンが同時に実行されている場合、 ClassCastException がスローされる可能性があります。
  • Elasticsearch 7 モジュールをデプロイした後、次の名前の構成ファイルを作成して、Elasticsearch 6 モジュールをブラックリストに追加する必要があります。
    com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config
    次の内容で:


  • blacklistBundleSymbolicNames=[ \
        "com.liferay.portal.search.elasticsearch6.api", \
        "com.liferay.portal.search.elasticsearch6.impl", \
        "com.liferay.portal.search.elasticsearch6.spi", \
        "com.liferay.portal.search.elasticsearch6.xpack.security.impl", \
        "Liferay Connector to X-Pack Security [Elastic Stack 6.x] - Impl" \
    ]
    

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base