我有一个使用Spring 3.0.1和apache CXF 2.4正常工作的项目,但由于apache CXF 2.4中存在内存泄漏问题,我已升级到版本apache CXF 2.7.3但它无法使用spring 3.0 .1也不是最新版本的Spring版本3.2.1。以下提供例外情况。我正在使用maven并在pom.xml中提供了依赖
Feb 27, 2013 11:16:05 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet CXFServlet
java.lang.ClassNotFoundException: org.springframework.web.context.support.XmlWebApplicationContext
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2300)
at java.lang.Class.getDeclaredFields(Class.java:1745)
at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:181)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1153)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
答案 0 :(得分:0)
@Real 评论 “来自堆栈跟踪,任何XmlWebApplicationCentext类都无法访问,我很清楚。我猜jar不在类路径中” 帮助我,我通过添加spring-web依赖来解决问题。
答案 1 :(得分:0)
将spring-web添加到依赖项对我来说不起作用。作为一种解决方法,我将其降级为CXF 2.5.0