Legacy Knowledge Base
公開されました Sep. 10, 2025

7.2 Spring/Faces WAR ポートレットから SOAP Web サービスを呼び出そうとすると、ServiceConfigurationError がスローされる

Written By

John Park

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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • 7.2 Spring/Faces WAR ポートレットから SOAP Web サービスを呼び出そうとすると、次の ServiceConfigurationError がスローされます。

java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1236)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
at javax.xml.ws.spi.ServiceLoaderUtil.firstByServiceLoader(ServiceLoaderUtil.java:33)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:59)
at javax.xml.ws.spi.Provider.provider(Provider.java:66)
at javax.xml.ws.Service.<init>(Service.java:82)
at org.oorsprong.websamples.CountryInfoService.<init>(CountryInfoService.java:44)
at com.test.SOAPProcessor.processSOAPRequest(SOAPProcessor.java:12)
at com.test.ModePhaseListener.afterPhase(ModePhaseListener.java:23)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)

Environment

  • DXP 7.2

解決策

  • この問題は、タイプ com.sun.xml.ws.spi.ProviderImpl のインスタンスがクラス javax.xml.ws.spi.Provider から「割り当て可能」ではないことが原因である可能性があります。 この種の問題が発生した場合、ほとんどの場合、クラスパスに重複したクラス定義の問題があることを意味します。 例として、これは、WAR に WEB-INF/jaxws-api.jar と WEB-INF/jaxws-rt.jar があるが、Liferay DXP のクラスパスで API がそのまま提供されている場合に発生する可能性があり、実装すぐに使用できます。

  • 概念実証として、2 つのサンプル アーティファクトが添付されています。

    • sample-faces-portlet-src.zip: プロジェクトのソースコードです

    • SampleFacesPortlet.war: これは、ソース コードからビルドされた 16 MB のスリム化されたバージョンです。

  • このサンプルは Java 8 でのみ機能することに注意してください。 Java 11 では、XML 解析や SOAP 実行に関連する標準のクラスパス構成の一部が変更されました。

  • ポートレットがページにデプロイされると、次のように表示されます。

    Check the console log for a list of continents from the SOAP processor

    コンソール ログを確認すると、次のように表示されます。

    Continents found: 6
    Africa
    Antarctica
    Asia
    Europe
    Ocenania
    The Americas

Did this article resolve your issue ?

Legacy Knowledge Base