啟動 CXF 服務端時拋出異常堆疊:
Caused by: java.io.IOException: Could not find destination factory for transport https://schemas.xmlsoap.org/soap/http
at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:133)
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace https://cxf.apache.org/transports/http.
at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122)
CXF 核心模組 未包含 HTTP 傳輸實現。CXF 採用模組化設計,HTTP 傳輸需額外引入 cxf-rt-transports-http 模組。
在 pom.xml 添加依賴(版本與 CXF 核心一致,如 3.1.5):
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.1.5</version>
</dependency>
<!-- 如需 JSON/REST 支援 -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>3.1.5</version>
</dependency>