2013-06-25 41 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> 

Tôi đang sử dụng Maven để xây dựng Ứng dụng. Sau khi mvn clean và mvn install tôi triển khai ứng dụng trong Tomcat sau đó tôi nhận được lỗi sau 'Dòng 11 trong tài liệu XML từ tài nguyên ServletContext [/WEB-INF/classes/cxf-beans.xml] không hợp lệ; ngoại lệ lồng nhau là org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: Ký tự đại diện phù hợp là nghiêm ngặt, nhưng không có khai báo nào có thể được tìm thấy cho phần tử 'jaxws: endpoint'. 'Lỗi trình phân tích cú pháp cxf-beans.xml không có khai báo nào có thể được tìm thấy cho phần tử 'jaxws: endpoint'

Trả lời

7

Cấu hình lò xo của bạn trông không sao. Vì vậy, lý do duy nhất tôi có thể nghĩ là bạn đang thiếu một trong những người phụ thuộc trong classpath của bạn (nhiều khả năng 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> 

Hãy chắc chắn rằng bạn có chúng trong pom.xml của bạn và nó sẽ làm việc.

+0

Cảm ơn rất nhiều paulius. Sẽ kiểm tra và cập nhật cho bạn một số – bharanitharan

+0

Nó hoạt động như một nhà vô địch. Thực ra tôi mới bắt đầu sử dụng maven. – bharanitharan