Results 1 to 5 of 5

Thread: NoClassDefFoundError: org/objectweb/asm/CodeVisitor

Hybrid View

  1. #1

    Default NoClassDefFoundError: org/objectweb/asm/CodeVisitor

    I'm missing class org.objectweb.wsm.CodeVisitor. I use library asm-2.2-bin.jar but none of packages contains this class. Where can I get library with this class included.

    thx...

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I don't know about asm 2.2 but it's present in asm 2.1; asm comes in different packed jar and probably you haven't downloaded the full one. If you are using cglib there is a _nodep version which includes the needed classes from asm so you don't need them anymore.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3

    Default

    I also ran into the same problem. This is what the message returns.
    Code:
    2006-06-18 17:09:36,182 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeProxy' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.transaction.interceptor.TransactionProxyFactoryBean]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
    Caused by: 
    org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.transaction.interceptor.TransactionProxyFactoryBean]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
    Caused by: 
    java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
            at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
            at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
            at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
            at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
            at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
            at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
            at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
            at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
            at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:164)
            at org.springframework.aop.framework.DefaultAopProxyFactory.<clinit>(DefaultAopProxyFactory.java:57)
            at org.springframework.aop.framework.ProxyConfig.<init>(ProxyConfig.java:72)
            at org.springframework.aop.framework.AbstractSingletonProxyFactoryBean.<init>(AbstractSingletonProxyFactoryBean.java:38)
            at org.springframework.transaction.interceptor.TransactionProxyFactoryBean.<init>(TransactionProxyFactoryBean.java:106)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
            at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:82)
            at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:59)
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:52)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:501)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:356)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:256)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:167)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:253)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:332)
            at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
            at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
            at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2990)
            at org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java:906)
            at org.apache.catalina.manager.HTMLManagerServlet.reload(HTMLManagerServlet.java:473)
            at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:98)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)
    I already placed the cglib_nodep.jar package in the classpath. How do I fix this problem?

    Thnx in advance.

  4. #4
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Perhaps there is a second cglib jar hanging around in your classpath. Maybe from hibernate or some other lib that also uses Cglib. If that comes first in the classpath and is an incompatible version it might well cause that problem.

    Regards,
    Andreas

  5. #5
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    I had this problem after updating to hibernate 3.1.3, which ships with an updated asm jar with the CodeVisitor class retired. I solved it by using the cglib jar from Spring, instead of the one from hibernate. The cglib jar coming in Spring specifically has all the old asm classes rolled up in itself.
    --Jing Xue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •