2013-06-25 82 views
5
<?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安裝後,我在Tomcat中部署應用程序,之後我收到以下錯誤'ServletContext資源中的第11行XML文檔[/WEB-INF/classes/cxf-beans.xml]無效;嵌套異常是org.xml.sax.SAXParseException:cvc-complex-type.2.4.c:匹配的通配符是嚴格的,但是對於元素'jaxws:endpoint'沒有聲明。解析器錯誤cxf-beans.xml無法找到元素'jaxws:聲明'的聲明:

回答

7

你的彈簧配置看起來沒問題。所以,我能想到的唯一理由是,你是(最有可能cxf-rt-frontend-jaxws)失蹤者的一個依賴於你的classpath:

<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,它應該工作。

+0

非常感謝paulius。將檢查和更新你一樣 – bharanitharan

+0

它像一個冠軍。其實我剛開始使用maven。 – bharanitharan

相關問題