Aug/090
MyEclipse Hibernate/RESTful web services MethodNotFound Error
So there I was happily setting up my code when I get an error. This was using Hibernate 3.2 and JAX-RS 1.0.2 web services for running some web services to add users to a database on MyEclipse 7.5.
What was the issue? When I try accessing the project if the data is verified ok and is to be added to the database the following Exception cropped up:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter
A bit more investigation yields the problem to be asm.jar issues. v1.5.3 is bundled with the Hibernate 3.2 package and a newer sounding v3.1 with the JAX-RS libraries bundled with MyEclipse.
What could be done? Well the reason the asm.jar file is needed in Hibernate is because of another JAR file cglib. This is called a dependancy and we can stop the problem by replacing this with a non-dependant version and then taking away the old asm.jar file.
- Download the cglib nodep JAR file fromĀ http://cglib.sourceforge.net/. Place the JAR file in a repository somewhere.
- Open MyEclipse -> Preferences -> Project Capabilities -> Hibernate.
- Select Hibernate 3.2 from the Tabs
- Switch the view from the drop down menu to view the JAR files for the Core Library.
- Click Add JAR/ZIP Button and select the downloaded cglib-nodep-x.x.jar downloaded in Step 1.
- In the list locate asm.jar and remove.
- In the list locate the cglib-x.x.jar file and remove.
- At this point your list screen will probably look like the screen below. Click OK.
- Stop the server and undeploy the applicaton
- Restart the server and redeploy the application

No comments yet.
Leave a comment
No trackbacks yet.