用于servlet spring-ws的Spring Web服务Servlet.init()引发了异常

时间:2012-08-26 18:28:37

标签: spring service web

我正在尝试学习Spring Web服务,我找到了这个教程: http://jeromebulanadi.wordpress.com/2010/02/25/basic-spring-web-service-tutorial-from-contract-to-security/#comment-302

我在eclipse中导入了项目prerson,添加了jar文件,但是当我运行项目并输入时:

http://localhost:8080/person/Person.wsdl

我收到了这个错误:

javax.servlet.ServletException: Servlet.init() for servlet spring-ws threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:662)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘Person’ defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
你能帮帮我吗? 感谢。

3 个答案:

答案 0 :(得分:1)

java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker

xalan-2.7.1.jar添加到您的CLASSPATH。

答案 1 :(得分:1)

使用xalan-2.7.0.jar。它对我有用。

答案 2 :(得分:0)

我找到了解决这个问题的方法,只是将serializer.jar添加到我的类路径中,现在它正在运行,看起来xalan-2.7.1.jar缺少TreeWalker。