facebook

java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #301898 Reply

    igemini
    Member

    I am using Hibernate 3.2 and JAX-RS 1.0.2 web services for running some web services to add users to a database. I am using MyEclipse 7.5.

    When I try accessing the project if the data is verified ok and is to be added to the database the following Exception crops up:
    java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter

    It looks like the missing method comes from the asm.jar with Hibernate 3.2.4 and the error occurs with both the built in Tomcat 6 that comes with MyEclipse and the Tomcat 5.5.17 server I have to mirror the deployment server. Are these JAR files bundled with the project or should they be copied over seperately for these servers?

    Please advise.

    Full exception in the next post.

    #301899 Reply

    igemini
    Member

    exception
    javax.servlet.ServletException: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
    com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:310)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:314)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:239)

    root cause
    com.sun.jersey.api.container.MappableContainerException: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:74)
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:154)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:543)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:502)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:493)
    com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:308)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:314)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:239)

    root cause
    java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
    net.sf.cglib.core.DebuggingClassWriter.<init>(DebuggingClassWriter.java:47)
    net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30)
    net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24)
    net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
    net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
    net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
    net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
    net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
    net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
    org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
    org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
    org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
    org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
    org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
    org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
    org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
    org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
    org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
    org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
    org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
    org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
    com.sixteen30.kmart55.config.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:31)
    com.sixteen30.kmart55.database.BaseHibernateDAO.getSession(BaseHibernateDAO.java:14)
    com.sixteen30.kmart55.api.UserServices.triggerNewUserAdd(UserServices.java:94)
    com.sixteen30.kmart55.api.UserServices.AddNewUser(UserServices.java:55)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
    com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
    com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:154)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
    com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
    com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
    com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:543)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:502)
    com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:493)
    com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:308)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:314)
    com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:239)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.

    #301900 Reply

    igemini
    Member

    Got the issue I think – Hibernate 3.2 uses an asm.jar v1.5.3 and the JAX-RS web services use asm-3.1.jar which I think generates the conflict.

    #301904 Reply

    igemini,
    The work around is posted in the following link
    http://www.hildeberto.com/2008/05/hibernate-and-jersey-conflict-on.html
    To modify your jar files you need to go to
    Windows > Preferences > MyEclipse Enterprise Wrokbench > Project Capabilities > Hibernate
    Please note that the changes will effect all the projects in the workspace. You can revert the changes by clicking “Restore Defaults”
    Let me know if that helps.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter

You must be logged in to post in the forum log in