- This topic has 1 reply, 2 voices, and was last updated 13 years, 3 months ago by
cconway.
-
AuthorPosts
-
Bill WarshawMemberI am trying to test my applicaiton in MyEclipse Tomcat embedded server. One of my libraries requires the use of cglib-nodep-2.2.jar. I am also using Hibernate, via the ME4S JPA Database Reverse Engineering wizard.
When I run my JUNIT tests in Eclipse everything is fine, but when I “Run As My Eclipse Server Application: I get the following exception:
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassWriter
I debugged this a bit and discovered that ME4S deployed the file cglib-2.2.jar to WEB-INF\lib (along with cglib-nodep-2.2.jar). Removing cglib-2.2.jar from this directory gets rid of the exception.
Looking at my project preferences I can see that cglib-2.2.jar is coming from “Hibernate 3.3 Core Libraries”. However, cglib-nodep-2.2.jar is listed above it under “Order and Export”. I’m relatively new to Java and TC server, so any assistance would be greatly appreciated.
cconwayMemberHi bwarshaw,
I don’t think you should expect the cglib-nodep-2.2.jar being listed above the cglib-2.2.jar to resolve the problem. The classes from the nodep jar will be found first which allows you to override classes but that jar will not prevent the classes from the subsequent jars from being loaded. If the cglib-2.2.jar requires a class, it will still need to have it in the path.
The good news is that you can configure the “Hibernate 3.3 Core Libraries” container to not include the cglib jar. To configure the set of jars:
1. Select the Windows > Preferences menu option.
2. In the left panel, expand MyEclipse > Project Capabilities
3. Select the Hibernate node.
4. Select the Hibernate 3.3 tab
5. Select the “Hibernate 3.3 Core Libraries” option in the combo box.
6. There you will see the set of Jars that are added to the project for the Hibernate 3.3 Core Libraries option and you can remove the ones you don’t want.This is a workspace-level configuration so once you’ve done it, the configuration will apply to all of your projects.
I hope this helps.
-
AuthorPosts