30
Aug/09
0

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.

  1. Download the cglib nodep JAR file fromĀ http://cglib.sourceforge.net/. Place the JAR file in a repository somewhere.
  2. Open MyEclipse -> Preferences -> Project Capabilities -> Hibernate.
  3. Select Hibernate 3.2 from the Tabs
  4. Switch the view from the drop down menu to view the JAR files for the Core Library.
  5. Click Add JAR/ZIP Button and select the downloaded cglib-nodep-x.x.jar downloaded in Step 1.
  6. In the list locate asm.jar and remove.
  7. In the list locate the cglib-x.x.jar file and remove.
  8. At this point your list screen will probably look like the screen below. Click OK.
  9. Stop the server and undeploy the applicaton
  10. Restart the server and redeploy the application

myeclipse-hibernate library changes screen grab

Filed under: MyEclipse
Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.