Integrate SSH conflict packages in myeclipse

Source: Internet
Author: User

Method 1:
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

If hibernate uses 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. Remove the three lib related to hibernate from the class path.
ASM. Jar
Asm-attrs.jar
Cglib-2.1.3.jar

2. Add the 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

Method 2:
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

If hibernate uses Lib:
ASM. jarasm-attrs.jar
There is a class conflict between the asm-2.2.2.jar and ASM. jar.
If one or both of them are used, the following error may occur: Java. lang. noclassdeffounderror: ORG/objectweb/ASM/codevisitorjava. lang. noclassdeffounderror: ORG/objectweb/ASM/commons/emptyvisitorjava. lang. nosuchmethoderror: Org. objectweb. ASM. classvisitor. visit

The following is a solution to manually edit your. classpath file, such as me (only part of the content)






Manually copy the last two lines of Hibernate and MySQL drivers to the front of the springframework Lib.
<Classpathentry kind = "con" Path = "melibrary.com. genuitec. Eclipse. hibernate. myeclipse_hibernate3_javascore"/>
<Classpathentry kind = "lib" Path = "webroot/WEB-INF/lib/mysql-connector-java-5.0.4-bin.jar"/>
<Classpathentry kind = "con" Path = "melibrary.com. genuitec. Eclipse. springframework. myeclipse_spring20_core"/>
<Classpathentry kind = "con" Path = "melibrary.com. genuitec. Eclipse. springframework. myeclipse_spring20_dao"/>
<Classpathentry kind = "con" Path = "melibrary.com. genuitec. Eclipse. springframework. myeclipse_spring20_aop"/>
<Classpathentry kind = "con" Path = "melibrary.com. genuitec. Eclipse. springframework. myeclipse_spring20_web"/>

If you try to start the service again, no error will be reported.

I used the jar package of myeclipse here. If you use a custom jar package, you only need to ensure that the spring jar package is loaded after hibernate, and the spring jar package will overwrite the hibernate jar package during project deployment.

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.