Spring Web 服务抛出异常

Spring Web 服务抛出异常

问题描述:

我正在做这个链接的 spring 网络服务示例 (http://justcompiled.blogspot.in/2010/09/building-web-service-with-spring-ws.html) ,我有例外.

I am doing spring web services example of this link (http://justcompiled.blogspot.in/2010/09/building-web-service-with-spring-ws.html) , I got exception.

成功运行这个项目的任何建议.

Any kind of advice for successful run this project.

我的项目配置:

工具:日蚀靛蓝,

服务器:Tomcat 7.

Server : Tomcat 7.

Java:JDK、JRE 1.6

Java : JDK, JRE 1.6

部署:Weapps(在我的项目中)

Deploy: Weapps (Inside my project )

我的例外:

HTTP 状态 500 -

HTTP Status 500 -

输入异常报告

留言

描述服务器遇到内部错误 (),阻止它完成此请求.

description The server encountered an internal error () that prevented it from fulfilling this request.

例外

javax.servlet.ServletException: Servlet.init() for servlet spring-ws threw exception
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)
root cause

java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:431)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)

我在我的项目中遇到了同样的问题.这个问题的根本原因是你必须使用两个版本的spring.您可以在存储库文件夹 (org\springframework\spring-web) 或 (org\springframework\spring-webmvc) 中检查相同的内容.您可以从那里删除一个版本.我在同一个工作区中打开了其他项目,该项目指的是其他版本的 spring.当我关闭另一个项目并清理和构建时,这解决了我的问题.

I had same issue in my project. The root cause of this issue is you have to two version of spring. You can check the same thing inside your repository folder (org\springframework\spring-web) or (org\springframework\spring-webmvc). You can delete the one version from there. I have other project opened in same workspace which was referring to other version of spring. When I closed that other project and cleaned and built, that has resolved my issue.

谢谢卡皮尔