Apache Tomcat设置java.lang.NoClassDefFoundError:org / springframework / asm / ClassVisitor [英] Apache Tomcat Setup java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor

查看:88
本文介绍了Apache Tomcat设置java.lang.NoClassDefFoundError:org / springframework / asm / ClassVisitor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过ubuntu软件包管理器安装了tomcat。我打开日志,看到的第一件事是一个有趣的异常。

I have just installed tomcat through the ubuntu package manager. I open the log and the first thing I see is an interesting exception.

java.lang.NoClassDefFoundError:org / springframework / asm / ClassVisitor

java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor

我在安装中缺少东西吗?

Am I missing something in the installation?

应该说,我重新安装的原因是我给了我首先使用Tomcat进入Web服务,但这没有用。但是现在:为什么我会收到此异常?
我出于好意而粘贴了整个日志:

It should be said that the reason I reinstalled in the first place was that I was giving my first go at webservices using Tomcat, and that didn't work. But for now: Why am I getting this exception? I pasted the entire log out of kindness:

Feb 13, 2012 10:00:17 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Feb 13, 2012 10:00:17 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor
at org.springframework.context.support.AbstractRefreshableApplicationContext.customizeBeanFactory(AbstractRefreshableApplicationContext.java:218)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.springframework.asm.ClassVisitor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
... 31 more
Feb 13, 2012 10:00:17 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Feb 13, 2012 10:02:30 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Feb 13, 2012 10:02:30 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class     org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor
at org.springframework.context.support.AbstractRefreshableApplicationContext.customizeBeanFactory(AbstractRefreshableApplicationContext.java:218)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.springframework.asm.ClassVisitor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
... 31 more
Feb 13, 2012 10:02:30 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext


推荐答案

Tomcat似乎正试图部署一个依赖于Spring ASM的Web应用程序,但是它无法在类路径中找到Spring ASM的JAR文件。我不确定您的Web应用程序正在使用哪个版本的Spring,但是该JAR文件的最新版本(截至今天)是3.1.0.RELEASE。

It looks like Tomcat is trying to deploy a web app that relies on Spring ASM but it can't find the JAR file for Spring ASM on the classpath. I'm not sure what version of Spring your web app is using, but the latest version (as of today) for that JAR file is 3.1.0.RELEASE.

如果您使用的是Maven,则可以通过将缺少的JAR文件添加到项目的pom.xml中来将其添加到项目中:

If you're using Maven, you can add the missing JAR file to your project by adding this to your project's pom.xml:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>org.springframework.asm</artifactId>
    <version>3.1.0.RELEASE</version>
</dependency>

如果您不使用Maven管理依赖项,则可以获取org.springframework.asm -3.1.0.RELEASE.jar(或所需的任何版本),方法是从 http://www.springsource.org/spring-community-download 。然后,需要将ASM jar文件放置在项目的WEB-INF / lib文件夹中。

If you're not using Maven to manage your dependencies, then you can obtain org.springframework.asm-3.1.0.RELEASE.jar (or whichever version you need) by downloading the entire Spring Framework from http://www.springsource.org/spring-community-download. The ASM jar file will then need to be placed in your project's WEB-INF/lib folder.

这篇关于Apache Tomcat设置java.lang.NoClassDefFoundError:org / springframework / asm / ClassVisitor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆