gpt4 book ai didi

maven - 解析器错误 cxf-beans.xml 找不到元素 'jaxws:endpoint' 的声明

转载 作者:行者123 更新时间:2023-12-04 18:09:44 24 4
gpt4 key购买 nike

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint xmlns:tns="http://sampleService.viasat.com/"
id="sampleserviceinterfcae" implementor="com.viasat.sampleservice.SampleServiceInterfcaeImpl"
wsdlLocation="wsdl/sampleserviceimplementation.wsdl" endpointName="tns:SampleServiceImplementationPort"
serviceName="tns:SampleServiceImplementationService" address="/SampleServiceImplementationPort">
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
</jaxws:features>
</jaxws:endpoint>
</beans>
我正在使用 Maven 来构建应用程序。后 mvn cleanmvn install我在 Tomcat 中部署应用程序,之后出现以下错误:

Line 11 in XML document from ServletContext resource [/WEB-INF/classes/cxf-beans.xml] is invalid;

nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jaxws:endpoint'

最佳答案

你的 Spring 配置看起来不错。所以我能想到的唯一原因是你的类路径中缺少这些依赖项之一(很可能是 cxf-rt-frontend-jaxws ):

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>${cxf.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>${cxf.version}</version>
<scope>compile</scope>
</dependency>

确保您的 pom.xml 中有它们它应该工作。

关于maven - 解析器错误 cxf-beans.xml 找不到元素 'jaxws:endpoint' 的声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17299754/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com