Spring 3.0 webapp NoClassDefFoundError - 类路径问题
尽管 WEB-INF/ 中有 org.springframework.web-3.0.2.RELEASE.jar,但我的 Web 应用程序无法找到 org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean 类lib 目录。如果我将旧版本的 spring.jar(2.5.6) 添加到 web 应用程序,则会找到该类。任何想法为什么会发生这种情况以及如何修复它而不恢复到 spring-2.5.6 或将两个版本的 spring 保留在同一个 web 应用程序中?
我正在 Tomcat 6.0.28 上部署。
这是错误:
- 引起:java.lang.NoClassDefFoundError:org/springframework/remoting/httpinvoker/HttpInvokerProxyFactoryBean
以下是类路径(WEB-INF/lib)中的 spring jar:
- org.springframework.aop-3.0.2.RELEASE。 jar
- org.springframework.asm-3.0.2.RELEASE.jar
- org.springframework.beans-3.0.2.RELEASE.jar
- org.springframework.context-3.0.2.RELEASE.jar
- org.springframework.core-3.0.2。 RELEASE.jar
- org.springframework.expression-3.0.2.RELEASE.jar
- org.springframework.web-3.0.2.RELEASE.jar
- org.springframework.web.servlet-3.0.2.RELEASE.jar
可能相关的问题:
My webapp fails to find org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean class despite having org.springframework.web-3.0.2.RELEASE.jar in the WEB-INF/lib directory. If I add an older version of spring.jar(2.5.6) to the webapp, then the class is found. Any ideas why this may be occurring and how I can fix it without reverting to spring-2.5.6 or keeping both versions of spring in the same webapp?
I am deploying on Tomcat 6.0.28.
Here's the error:
- Caused by: java.lang.NoClassDefFoundError: org/springframework/remoting/httpinvoker/HttpInvokerProxyFactoryBean
Here are the spring jars in the classpath (WEB-INF/lib):
- org.springframework.aop-3.0.2.RELEASE.jar
- org.springframework.asm-3.0.2.RELEASE.jar
- org.springframework.beans-3.0.2.RELEASE.jar
- org.springframework.context-3.0.2.RELEASE.jar
- org.springframework.core-3.0.2.RELEASE.jar
- org.springframework.expression-3.0.2.RELEASE.jar
- org.springframework.web-3.0.2.RELEASE.jar
- org.springframework.web.servlet-3.0.2.RELEASE.jar
Possibly related questions:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NoClassDefFoundError
与ClassNotFoundException
不同。这意味着找不到 HttpInvokerProxyFactoryBean 内部使用的类定义,而不是类本身。换句话说,
HttpInvokerProxyFactoryBean
及其超类的所有导入类都必须在类路径中找到。由于
HttpInvokerProxyFactoryBean
是org.springframework.aop.framework.ProxyFactory
的子类,并且ProxyFactory
依赖于aopalliance-1.0.jar< /code>,您需要将其包含在您的类路径中。
NoClassDefFoundError
isn't the same asClassNotFoundException
. It means the class definition used insideHttpInvokerProxyFactoryBean
cannot be found, not the class itself.In other words, all the import classes of
HttpInvokerProxyFactoryBean
and of its superclasses must be found in your classpath.Since the
HttpInvokerProxyFactoryBean
is a subclass oforg.springframework.aop.framework.ProxyFactory
andProxyFactory
depends onaopalliance-1.0.jar
, you will need to include this in your classpath.