1. 程式人生 > >Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor錯誤原因與解決辦法

Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor錯誤原因與解決辦法

Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor錯誤原因與解決辦法

 

Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor錯誤原因與解決辦法。

1、錯誤描述

 

[plain] view plaincopy在CODE上檢視程式碼片派生到我的程式碼片

  1. 資訊: Setting autowire strategy to name
  2. 2014-7-13 1:37:43 org.apache.struts2.spring.StrutsSpringObjectFactory info
  3. 資訊: … initialized Struts-Spring integration successfully
  4. 2014-7-13 1:37:44 org.apache.catalina.core.StandardContext filterStart
  5. 嚴重: Exception starting filter struts2
  6. java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
  7.     at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:390)
  8.     at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347)
  9.     at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
  10.     at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:268)
  11.     at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
  12.     at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445)
  13.     at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
  14.     at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
  15.     at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
  16.     at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
  17.     at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
  18.     at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
  19.     at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809)
  20.     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485)
  21.     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  22.     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
  23.     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
  24.     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
  25.     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
  26.     at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
  27.     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
  28.     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  29.     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  30.     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  31.     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  32.     at java.lang.Thread.run(Thread.java:619)
  33. Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
  34.     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
  35.     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
  36.     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
  37.     … 26 more
  38. 2014-7-13 1:37:44 org.apache.catalina.core.StandardContext startInternal
  39. 嚴重: Error filterStart
  40. 2014-7-13 1:37:44 org.apache.catalina.core.StandardContext startInternal
  41. 嚴重: Context [/FirstSSH] startup failed due to previous errors
  42. 2014-7-13 1:37:44 org.apache.catalina.core.ApplicationContext log
  43. 資訊: Closing Spring root WebApplicationContext
  44. 2014-7-13 1:37:44 org.springframework.web.context.support.XmlWebApplicationContext doClose
  45. 資訊: Closing Root WebApplicationContext: startup date [Sun Jul 13 01:37:37 CST 2014]; root of context hierarchy
  46. 2014-7-13 1:37:44 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
  47. 嚴重: The web application [/FirstSSH] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  48. 2014-7-13 1:37:44 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
  49. 嚴重: The web application [/FirstSSH] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
  50. 2014-7-13 1:37:44 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
  51. 嚴重: The web application [/FirstSSH] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [[email protected]]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
  52. 2014-7-13 1:37:44 org.apache.catalina.startup.HostConfig deployDirectory

2、錯誤原因

      通過這句“Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor”可知,是缺少有關asm jar包

3、解決辦法

     將“asm-3.3.1.jar”複製到lib目錄下,重新啟動服務