Conflict between the ASM package during zzspring and hibernate Integration

Source: Internet
Author: User
Mlgbd. It will be handed over tomorrow. Today it is equipped with a one-day environment. Really ..... Thanks for saving me in the following article. Thank you very much.

Http://apps.hi.baidu.com/share/detail/33127760

Org. springframework. beans. factory. beancreationexception: Error creating bean with name 'sessionfactory 'defined in servletcontext resource [/WEB-INF/classes/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;) vcaused by: Java. lang. nosuchmethoderror: Org. objectweb. ASM. classvisitor. visit (iiljava/lang/string; ljava/lang/string; [ljava/lang/string;) V at net. SF. cglib. core. classemitter. begin_class (classemitter. java: 77)

The online statement is really uneven, and finally find a way to solve the problem (tossing me for one afternoon, it's going crazy)

Cause:

These libraries are used in Spring AOP programming:
Asm-2.2.2.jar
Asm-commons-2.2.2.jar
Asm-util-2.2.2.jar
Hibernate uses the following Lib: ASM. Jar
Asm-attrs.jar

The asm-2.2.2.jar and ASM. jar have a class conflict !!!
If either of them is used, the following error may occur:
Java. Lang. noclassdeffounderror: ORG/objectweb/ASM/codevisitor
Java. Lang. noclassdeffounderror: ORG/objectweb/ASM/commons/emptyvisitor
Java. Lang. nosuchmethoderror: org. objectweb. ASM. classvisitor. Visit

Solution:

1.Remove3 lib of hibernate in the class path
ASM. Jar
Asm-attrs.jar
Cglib-2.1.2.jar
2.JoinThe following four libraries in spring
Asm-2.2.2.jar
Asm-commons-2.2.2.jar
Asm-util-2.2.2.jar
Cglib-nodep-2.1_3.jar

Your own small test: (running environment: APACHE-Tomcat-5.5.15 +. myeclipse_5.5ga_e3.2.2)

Integration SSH project, in the Tomcat deployment environment D: \ Tomcat \ webapps \ My \ WEB-INF \ Lib encountered a point of exception:
ASM. jar, asm-attrs.jar, asm-2.2.3.jar, asm-commons-2.2.3.jar
Asm-util-2.2.3.jar, cglib-nodep-2.1_3.jar
No exception occurs when Tomcat is started. (I think the asm-2.2.3jar may have been improved to some extent .)

Add WEB-INF under D: \ Tomcat \ webapps \ My \ cglib-2.1.3.jar \ Lib
The above java. Lang. nosuchmethoderror is reported:
Org. objectweb. ASM. classvisitor. Visit error message. It indicates that the cglib-2.1.3.jar conflicts with other packages.
Delete cglib-2.1.3.jar issue solved!

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.