加入了你给的依赖"<dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>3.4.4</version></dependency>"后,依然报错:"jakarta.xml.soap.SOAPException: Unable to create SAAJ meta-factory: Provider com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl not found at jakarta.xml.soap.SAAJMetaFactory.getInstance(SAAJMetaFactory.java:73) at jakarta.xml.soap.MessageFactory.newInstance(MessageFactory.java:126) at com.firstronix.webservice.WebServiceUtils.getSOAPMsgFactory(WebServiceUtils.java:86) at com.firstronix.webservice.WebServiceUtils.newBlankSOAPMessage(WebServiceUtils.java:136)",补充一点,我是在Polarion Server运行
时间: 2024-04-23 10:23:50 浏览: 31
根据错误信息,看起来是 SAAJ(SOAP with Attachments API for Java)的实现类没有找到导致的,可能是因为你的项目中缺少了 SAAJ 的实现类的依赖。
你可以尝试添加以下依赖来解决该问题:
```
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>javax.xml.soap-api</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.5.1</version>
</dependency>
```
如果还不行的话,你可以检查一下你的项目中是否存在多个版本的 SAAJ 实现类,导致冲突。如果存在多个版本的 SAAJ 实现类,你需要排除其中一个或多个版本的依赖。
希望能帮到你!
相关问题
我需要cxf-core、cxf-rt-bindings-soap、cxf-rt-bindings-xml、cxf-rt-databinding-jaxb、cxf-rt-frontend-simple、 cxf-rt-ws-addr、cxf-rt-ws-policy、cxf-rt-wsdl、wsdl4j、xml-resolver、xmlschema-core这些jar包,给出我在pom文件中需要的maven依赖配置
你可以在你的pom文件中添加以下依赖配置:
```
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-xml</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-jaxb</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-addr</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-policy</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-wsdl</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.ws.xmlschema</groupId>
<artifactId>xmlschema-core</artifactId>
<version>2.2.5</version>
</dependency>
</dependencies>
```
请注意,这些依赖的版本可能会随着时间的推移而更新。建议在使用这些依赖时,查阅官方文档以获取最新版本信息。
import org.apache.cxf.transport.servlet.CXFServlet的依赖
在 Maven 项目中,可以在 pom.xml 文件中添加以下依赖来使用 Apache CXF 框架:
```
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
```
其中,`${cxf.version}` 是 Apache CXF 框架的版本号,可以根据实际情况进行替换。这些依赖包含了 Apache CXF 框架的核心库和 HTTP/Jetty 传输库,可以用于发布和管理 Web 服务。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)