java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
异常完整信息
严重: Servlet.service() for servlet RegServlet threw exception
java.lang.NoSuchMethodError:
org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
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 com.centrain.exam.HibernateUtil.<clinit>(HibernateUtil.java:22)
at com.centrain.control.RegServlet.doGet(RegServlet.java:69)
at com.centrain.control.RegServlet.doPost(RegServlet.java:95)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
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:233)
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:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)</coolcode>
经过各方资料查找,发现是spring 与hibernate集成的时候,两大框架jar包有冲突!
解决办法:
1.去掉类路径上的关于Hibernate的asm开头的jar包以及cglib-2.1.2.jar(可能版本不一样)
asm.jar
asm-attrs.jar
cglib-2.1.2.jar
2.加入Spring中的以下4个lib
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
cglib-nodep-2.1_3.jar
问题完美解决!
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V的更多相关文章
- [spring] org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljav 解决
严重: Exception sending context initialized event to listener instance of class org.springframework.we ...
- Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
在学习CGlib动态代理时,遇到如下错误: Exception in thread "main" java.lang.NoSuchMethodError: org.objectwe ...
- 【错误总结】java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
运行环境 JDK1.7 64位 Window 7 64位 Ecplise Java EE IDE Struts 2.3.9 Tomcat 7 说明: ...
- Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
按教程,使用Convention插件进行配置 教程中说只要加入struts2-convention-plugin-2.3.4.1.jar这个jar包就可以使用. 按照这种方法部署后,启动tomcat报 ...
- Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
1.错误描写叙述 信息: Setting autowire strategy to name 2014-7-13 1:37:43 org.apache.struts2.spring.StrutsSpr ...
- java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter
在使用实验室的提供的AbstractDAO的时候报错:Exception in thread "main" java.lang.NoSuchMethodError: org.obj ...
- SSH整合后tomcat启动报错SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
错误信息: SEVERE: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/objectweb/asm/C ...
- mvn 编译错误java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter. <init>(Z)V
Spring+struts2 +hibernate3集成,在后台测试时报的错,报错的这句话: Exception in thread "main" java.lang.NoSuch ...
- Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
项目中各种缺包现象... Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V ...
随机推荐
- dubbox部署到jdk1.7环境,启动:java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()
本地用jdk1.8编译的服务提供端war包,部署到环境报错了: INFO: Initializing Spring root WebApplicationContext [16/08/17 05:14 ...
- dubbox消费者启动成功,却无法连接注册中心
使用dubbox作为服务提供端很好实现,因为git的说明和网上有很多的例子可供参考,但是消费端都一笔带过,简单得很,初学者往往以为只要配置如下3样东西就够了: <?xml version=&qu ...
- explain解析
MySQL执行计划调用方式执行计划包含的信息执行计划显示内容解读MySQL执行计划的局限MySQL5.6支持OPTIMIZER_TRACE 1.什么是归并排序?将已有序的子序列合并,得到完全有序的序列 ...
- MFC学习(六)计算器
1 stdafx.h 所谓头文件预编译,就是把一个工程(Project)中使用的一些MFC标准头文件(如Windows.H.Afxwin.H)预先编译,以后该工程编译时,不再编译这部分头文件,仅仅使 ...
- ARM-Linux移植之(三)——init进程启动流程分析
我们通常使用Busybox来构建根文件系统的必要的应用程序.Busybox通过传入的参数来决定执行何种操作.当init进程启动时,实际上调用的是Busybox的init_main()函数,下面我们来分 ...
- 大杀器TheFatRat
项目地址:https://github.com/Screetsec/TheFatRat 安装TheFatRat root@sch01ar:/sch01ar# git clone https://git ...
- hardentools
Hardentools是一组简单的实用程序,旨在禁用操作系统(Microsoft Windows,现在)以及主要的消费者应用程序公开的许多“功能”.这些通常为企业客户所设想的功能,对于普通用户来说通 ...
- Python中常用模块一
random模块 import random # 应用数学计算 print(random.random()) # 取随机小数 范围是 0-1之间 # 应用抽奖 , 彩票 print(random.ra ...
- DataReader方式 获取数据
/// /// 得到一个对象实体 DataReader方式 /// /// /// 成功返回对象模型,失败返回null public DotNet.Model.Base_Department GetM ...
- centos7 时间设置及ntp
转自:https://blog.gtwang.org/linux/howto-set-date-time-from-linux-command-prompt/ 這裡介紹各種在 Linux 中以手動來調 ...