2013-05-14 75 views
1

即時使用Jax-WS與Spring和我的ApplicationContext不顯示任何錯誤,但是當我啓動我的Tomcat時會生成一個XML錯誤。JAX-WS文件過早結束。第1行XML

我的applicationContext:產生

<?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:ws="http://jax-ws.dev.java.net/spring/core" 
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet" 
xmlns:context="http://www.springframework.org/schema/context" 
xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://jax-ws.dev.java.net/spring/core 
    http://jax-ws.java.net/spring/core.xsd 
    http://jax-ws.dev.java.net/spring/servlet 
    http://jax-ws.java.net/spring/servlet.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context.xsd"> 

<wss:binding url="/hello"> 
    <wss:service> 
     <ws:service bean="#helloWs"/> 
    </wss:service> 
</wss:binding> 

<!-- Web service methods --> 
<bean id="helloWs" class="br.com.myproject.ws.HelloWorldWS"> 
    <property name="helloWorldBo" ref="HelloWorldBo" /> 
</bean> 

<bean id="HelloWorldBo" class="br.com.myproject.ws.HelloWorldBoImpl" /> 
</beans> 

此錯誤:

GRAVE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Premature end of file. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)

+0

你確定你的applicationContext.xml實際上是打包在你的war文件中,並存在於/ WEB-INF下嗎? – Kal 2013-05-14 17:51:43

回答

1

好了,從位置您模式定義,您正在使用dev.缺少像核心和servlet XSD的某些部分jaxws的定義。

應該如下:

http://jax-ws.dev.java.net/spring/core 
    http://jax-ws.dev.java.net/spring/core.xsd 
    http://jax-ws.dev.java.net/spring/servlet 
    http://jax-ws.dev.java.net/spring/servlet.xsd 

上述問題將得到解決。

相關問題