Wildfly26.1.1+JDK11+JEE8环境下SOAP Web服务POM依赖及部署问题
问题描述
使用Apache NetBeans 12.6搭配Wildfly 26.1.1、JDK 11、JEE 8创建SOAP Web Services时出现部署错误,此前用NetBeans 8.2 + JEE 7可正常创建。部署错误日志如下:
Deploying on WildFly Application Server profile mode: false debug mode: false force redeploy: true Undeploying ... Initial deploying WebServicesSOAP to D:\Applications Servers\wildfly-26.1.1\wildfly-26.1.1.Final\standalone\deployments\webServicesSOAP-1.0.war Completed initial distribution of WebServicesSOAP Deploying D:\Applications Servers\wildfly-26.1.1\wildfly-26.1.1.Final\standalone\deployments\webServicesSOAP-1.0.war "{ \"WFLYCTL0080: Failed services\" => {\"jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".INSTALL\" => \"WFLYSRV0153: Failed to process phase INSTALL of deployment \\\"webServicesSOAP-1.0.war\\\" Caused by: org.jboss.wsf.spi.WSFException: JBWS024109: Could not get WSDL contract for endpoint com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationPortImpl at /wsdls/wsc11/wstx-wscoor-1.1-wsdl-200702.wsdl\"}, \"WFLYCTL0412: Required services that are not installed:\" => [ \"jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".WeldStartService\", \"jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".beanmanager\" ], \"WFLYCTL0180: Services with missing/unavailable dependencies\" => [ \"jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".beanmanager, jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".WeldStartService]\", \"jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".batch.artifact.factory is missing [jboss.deployment.unit.\\\"webServicesSOAP-1.0.war\\\".beanmanager]\" ] }"
错误原因分析
- 核心错误为
JBWS024109: Could not get WSDL contract for endpoint...:WildFly内置的WS-Coordination相关WSDL文件无法加载,大概率是项目依赖与WildFly内置组件冲突,或WildFly未启用完整的JEE8 Web服务配置; - CDI服务缺失:日志显示
WeldStartService、beanmanager未安装,JEE8默认要求CDI支持,若项目未显式启用CDI或依赖配置缺失,会导致此类错误。
解决方案
1. 修复WS-Coordination WSDL加载问题
- 检查项目POM依赖,排除与WildFly内置JAX-WS/WS-Coordination冲突的外部依赖(例如自行引入的
jaxws-rt等实现包); - 切换WildFly启动配置为
standalone-full.xml,该配置文件启用了完整的JEE8 Web服务扩展,包含WS-Coordination所需组件。
2. 解决CDI服务缺失问题
- 在项目
src/main/webapp/WEB-INF目录下添加空的beans.xml文件,显式启用CDI支持; - 确保POM中JEE8 API依赖设置为
provided范围,避免打包进WAR包与WildFly内置组件冲突。
环境适配的POM依赖配置
以下是JEE8 + WildFly 26.1.1环境下创建SOAP Web Services的核心POM依赖:
<dependencies> <!-- JEE8核心API,包含SOAP Web Services、CDI、EJB等规范 --> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>8.0</version> <scope>provided</scope> </dependency> <!-- 可选:单独引入JAX-WS API(javaee-api已包含,仅需在特殊场景下添加) --> <dependency> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId> <version>2.3.1</version> <scope>provided</scope> </dependency> <!-- 可选:WildFly适配的JAX-WS规范依赖,确保与服务器版本兼容 --> <dependency> <groupId>org.jboss.spec.javax.xml.ws</groupId> <artifactId>jboss-jaxws-api_2.3_spec</artifactId> <version>2.0.0.Final</version> <scope>provided</scope> </dependency> </dependencies>
内容的提问来源于stack exchange,提问作者Gleiston Guerrero
相关产品推荐
相关产品推荐

