Spring配置http:conduit标签找不到声明,WildFly24启动报错如何解决?
错误原因
- Spring上下文的XSD Schema地址配置错误,是本次报错的核心诱因:
http://cxf.apache.org/jaxws对应的Schema地址错误写为jaxs.xsd,正确应为jaxws.xsdhttp://cxf.apache.org/jaxrs对应的Schema地址错误写为jars.xsd,正确应为jaxrs.xsdhttp://cxf.apache.org/transports/http/configuration对应的Schema地址误用了WSDL绑定的HTTP配置路径wsdl/http-conf.xsd,CXF HTTP传输配置的正确Schema路径为configuration/http-conf.xsd
- WildFly 24默认自带CXF模块,若与你Ant构建中引入的
${cxf.version}版本不一致,会优先加载容器自带的CXF类,导致Schema解析失败 - 若存在多个版本CXF依赖混用的情况,也会触发该类配置解析错误
修复步骤
- 修正Spring上下文的xsi:schemaLocation配置,将原有错误的三个Schema映射条目:
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/wsdl/http-conf.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxs.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jars.xsd
替换为正确的配置:
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
- 解决WildFly自带CXF模块冲突,在应用的
WEB-INF目录下新增jboss-deployment-structure.xml配置,排除容器自带的CXF相关模块:
<jboss-deployment-structure> <deployment> <exclusions> <module name="org.apache.cxf" /> <module name="org.apache.cxf.impl" /> <module name="org.apache.ws.security" /> </exclusions> </deployment> </jboss-deployment-structure>
- 确认Ant配置中所有CXF依赖的版本号完全统一,无多版本混用情况,建议使用3.4.x及以上稳定版本适配WildFly 24运行环境
- 清理构建缓存后重新打包部署,重启服务即可,修正后你的
http:conduit配置会正常生效,自定义的SSLSocketFactory可被正确传入
内容的提问来源于stack exchange,提问作者moh sajid khan
相关产品推荐
相关产品推荐

