`
kidiaoer
  • 浏览: 822587 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

Invocation of init method failed; nested exception is java.lang.NoSuchMethodErro

阅读更多

开发工具:MyEclipse8.5,Tomcat6.0

启动Tomcat报出此异常信息,出异常时正常的,但是出不认识的异常有些出乎预料。

2011-4-17 20:20:37 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;C:\Program Files\Genuitec\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_8.4.100.me200912131330\tomcat\bin
2011-4-17 20:20:37 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2011-4-17 20:20:38 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1448 ms
2011-4-17 20:20:38 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2011-4-17 20:20:38 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.13
2011-4-17 20:20:38 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\beyongsoftworkspace\.metadata\.me_tcat\webapps\lsal\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
2011-4-17 20:20:44 org.apache.catalina.core.ApplicationContext log
信息: Initializing WebApplicationContext for Struts ActionServlet 'action', module ''
2011-4-17 20:20:48 org.apache.catalina.core.ApplicationContext log
严重: action: null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationContext(ContextLoaderPlugIn.java:354)
	at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext(ContextLoaderPlugIn.java:295)
	at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn.java:225)
	at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
	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:525)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	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:566)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
	at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:165)
	at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
	at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
	at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
	at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
	at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
	at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
	at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
	at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
	at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
	at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
	at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
	at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
	at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
	at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
	at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
	... 44 more
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.CodeVisitor
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
	... 69 more
2011-4-17 20:20:48 org.apache.catalina.core.ApplicationContext log
信息: Marking servlet action as unavailable
2011-4-17 20:20:48 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /s1sh threw load() exception
javax.servlet.UnavailableException
	at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:880)
	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)
	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:525)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	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:566)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2011-4-17 20:20:48 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2011-4-17 20:20:48 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2011-4-17 20:20:48 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/62  config=null
2011-4-17 20:20:48 org.apache.catalina.startup.Catalina start
信息: Server startup in 9921 ms
2011-4-17 20:20:49 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
	at org.apache.struts.config.impl.ModuleConfigImpl.findActionConfig(ModuleConfigImpl.java:332)
	at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:757)
	at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
	at org.apache.jsp.form.register_jsp._jspx_meth_html_005fform_005f0(register_jsp.java:107)
	at org.apache.jsp.form.register_jsp._jspService(register_jsp.java:79)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)

	
	
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
方案:
在使用Spring的AOP编程时,会用到这几个lib:
asm-2.2.3.jar
asm-commons-2.2.3.jar
asm-util-2.2.3.jar
Hibernate使用如果lib:
asm.jar
asm-attrs.jar
其中asm-2.2.3.jar与asm.jar存在类上的冲突!!!
使用其中之一或两者都使用,可能会出现如下错误:
java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
java.lang.NoClassDefFoundError: org/objectweb/asm/commons/EmptyVisitor
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit。。。。。。
解决办法是:

1.去掉类路径上的关于Hibernate的3个lib
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
2.留着Spring中的以下4个lib
asm-2.2.3.jar
asm-commons-2.2.3.jar
asm-util-2.2.3.jar
cglib-nodep-2.1_3.jar
另一种解决方法

去掉Spring中的asm-2.2.3.jar

分享到:
评论

相关推荐

    解决axis2-CodegenWizardPluginBUG- java.lang.reflect.InvocationTargetException

    `InvocationTargetException`通常作为Java标准库中的`java.lang.reflect.Method.invoke()`方法的异常包装器。当目标方法抛出异常时,`invoke()`会捕获这个异常并封装为`InvocationTargetException`,然后将其抛出。...

    asm5.0.jar

    Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/E:/cloudwave-core/src/main/webapp/WEB- INF/classes/...

    MyEclipse axis2 wsdl java.lang.reflect.invocationtargetexception

    MyEclipse axis2 wsdl java.lang.reflect.invocationtargetexception code gen 大家要注意一定要仔细,这个问题基本上缺少包引起的,而且一定要clean 如果需要axis2插件 以及这个plugins中的包在我的其他资源里面有

    wsdl生成java客户端报错问题解决方法

    解决使用wsdl生成java客户端报错:java.lang.reflect.invocationtargetexception的方法之一

    axis2 InvocationTargetException

    标题 "axis2 InvocationTargetException" 描述的是一个与Apache Axis2框架相关的编程问题,该问题通常在执行服务调用时出现,提示"InvocationTargetException"。这可能是由于多种原因引起的,包括但不限于错误的服务...

    dubbo-monitor-simple.zip

    dubbo-monitor监控中心,基于alibaba dubbo.jar开发,解决Decode rpc invocation failed: expected map/object at java.lang.String (Ljava/lang/String)、com.alibaba.dubbo.common.URL' could not be instantiated...

    Java reflect 机制详解

    免费共享,很详细的介绍了反射机制的原理,适合追根究底的java学习者

    wsdl生成java客户端报错

    java.lang.reflect.invocationtargetexception问题的解决方法之一

    webservice启动没有问题,通过自动生成的客户端报错

    faultString: java.lang.reflect.InvocationTargetException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: AxisFault faultCode: {...

    短信猫西门子TC35测试

    java.lang.reflect.InvocationTargetException 刚开始无法解决后面网上查了下可能是没有加载comm.jar 于是就在classpath手动加载comm.jar再执行就没有问题短信成功发送. 我用jdk1.6是没问题 附带测试工程包 文档 ...

    uiautomatorviewer更新文件.rar

    解决uiautomatorviewer报错问题,分享给大家。 Unexpected error while obtaining UI hierarchy # 点击Details java.lang.reflect.InvocationTargetException

    Java各个包简述.pdf

    30. **java.rmi**:远程方法调用(Remote Method Invocation)包,支持分布式计算。 31. **java.rmi.activation**:RMI对象激活支持,允许对象在需要时自动创建。 32. **java.rmi.dgc**:RMI分布式的垃圾回收支持...

    javaApi分类[参考].pdf

    23. **Java.rmi**: 远程方法调用(Remote Method Invocation),支持分布式计算。 24. **Java.security**: 安全框架,包括加密、密钥管理、权限和证书。 25. **Java.sql**: 数据库访问API,如Connection、...

    JDK9-JSE- Java Remote Method Invocation API Guide-2.pdf

    Java Remote Method Invocation API Guide Java Remote Method Invocation(Java RMI)是一种允许开发者创建分布式应用程序的技术。Java RMI 允许对象在另一个 Java 虚拟机(JVM)上调用远程 Java 对象的方法,可能...

    servlet2.4doc

    Overrides the standard java.lang.Object.clone method to return a copy of this cookie. containsHeader(String) - Method in class javax.servlet.http.HttpServletResponseWrapper The default behavior of ...

    JavaSE-6.0-英文手册(2008/11/30_FullUpdate)

    Remote Method Invocation (RMI) RMI-IIOP Scripting for the Java Platform User Interface Libraries 2D Graphics and Imaging Accessibility Abstract Window Toolkit (AWT) Drag-and-Drop Data ...

Global site tag (gtag.js) - Google Analytics