Announcement Announcement Module
Collapse
No announcement yet.
java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor

    Hi,

    I'm new to Spring and trying to work through one of the tutorials while using the STS tools (Version: 2.3.0.RELEASE Build Id: 200912171331)

    The tutorial in question is this one:
    http://static.springsource.org/docs/...C-step-by-step

    The tutorial seems to be not quite up-to-date with recent tools and framework releases, so I'm just trying to use STS and latest Spring release and "fill in the gaps" as I go.

    I installed STS with tc-server. Rather than use the "build.xml" file in the tutorial I'm running this via the "Run As > Run On Server" and I seem to have gotten this working with just the "index.jsp" page (i.e. no beans used so far).

    When I start adding in Spring stuff in the web.xml files I'm running into problems.

    Here's what I did:
    1) Added a single "Hello" bean as in the tutorial's instructions.
    2) Downloaded: spring-framework-3.0.0.RELEASE
    3) Put all of its .jar files into the WebContent/WEB-INF/lib/ dir of my dynamic web project. (This seems to add them to my classpath as intended)

    I get this error: java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor while it is trying to initialize my webapp.

    I was guessing that it should be in "org.springframework.asm-sources-3.0.0.RELEASE.jar", but when I look into that .jar file, it appears to be empty (only a META-INF directory is present).

    Questions:

    1) Am I doing something wrong? (E.g. is downloading and copying them into my lib directory the right way to make STS tools find the spring jars)

    2) Where do I get the org.springframework.asm.ClassVisitor class that seems to be needed here.

    Thanks for any help with this problem.

    Picoday

    Server console output follows below (just in case it might be helpful in diagnosing the problem).

    Code:
    2-Feb-2010 3:47:25 PM com.springsource.tcserver.security.PropertyDecoder <init>
    INFO: tcServer property decoder has been initialized.
    2-Feb-2010 3:47:25 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:spring-dweb-app' did not find a matching property.
    2-Feb-2010 3:47:25 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
    INFO: Started up JMX registry on 127.0.0.1:6969
    2-Feb-2010 3:47:25 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    2-Feb-2010 3:47:25 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1468 ms
    2-Feb-2010 3:47:25 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    2-Feb-2010 3:47:25 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: SpringSource tc Server/6.0.20.C
    2-Feb-2010 3:47:28 PM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring FrameworkServlet 'springapp'
    2-Feb-2010 3:47:28 PM org.springframework.web.servlet.FrameworkServlet initServletBean
    INFO: FrameworkServlet 'springapp': initialization started
    2-Feb-2010 3:47:28 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing WebApplicationContext for namespace 'springapp-servlet': startup date [Tue Feb 02 15:47:28 PST 2010]; root of context hierarchy
    2-Feb-2010 3:47:29 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.customizeBeanFactory(AbstractRefreshableApplicationContext.java:218)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:388)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:587)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:290)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
    Caused by: java.lang.ClassNotFoundException: org.springframework.asm.ClassVisitor
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1384)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    	... 27 more
    2-Feb-2010 3:47:29 PM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /spring-dweb-app threw load() exception
    java.lang.ClassNotFoundException: org.springframework.asm.ClassVisitor
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1384)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.customizeBeanFactory(AbstractRefreshableApplicationContext.java:218)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:388)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:587)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:290)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
    Last edited by picoday; Feb 2nd, 2010, 07:05 PM.

  • #2
    OK... it looks like my problem goes away when I use the jar files from

    spring-framework-2.5.6.SEC01

    instead of the 3.0.0 jars.

    Comment


    • #3
      picoday,

      the 'org.springframework.asm-sources-3.0.0.RELEASE.jar' is only for the java sources. This file is intentionally empty as Spring ships a re-packaged version for ASM through the use of JarJar.

      You need to org.springframework.asm-3.0.0.RELEASE.jar file which should also be part of the Spring 3.0 distribution.

      Cheers, Christian
      Last edited by Christian Dupuis; Feb 3rd, 2010, 11:49 AM.

      Comment


      • #4
        I see what I did wrong now. Somehow I seem to have taken the source jar (from the src/ directory) instead of one from the dist/ dir. Silly mistake.

        Thanks for your help,

        Picoday
        Last edited by picoday; Feb 3rd, 2010, 11:30 AM. Reason: typo

        Comment

        Working...
        X