解析器错误cxf-beans.xml找不到元素'jaxws:endpoint'的声明 [英] Parser Error cxf-beans.xml no declaration can be found for element 'jaxws:endpoint'
问题描述
<?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 clean
和mvn install
之后,我在Tomcat中部署了应用程序,之后出现以下错误:
I'm using Maven to build the Application. After mvn clean
and mvn install
I deploy the application in Tomcat after which I'm getting the following error:
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'
推荐答案
您的弹簧配置看起来还不错.所以我能想到的唯一原因是,您在类路径中缺少这些依赖项之一(很可能是cxf-rt-frontend-jaxws
):
Your spring configurations looks alright. So the only reason I could think of is that you are missing one of those dependencies in your classpath (most likely 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
中,并且应该可以使用.
Make sure that you have them in your pom.xml
and it should work.
这篇关于解析器错误cxf-beans.xml找不到元素'jaxws:endpoint'的声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!