Results 1 to 4 of 4

Thread: Problem with tutorial

  1. #1
    Join Date
    Oct 2008
    Posts
    5

    Default Problem with tutorial

    Hi all,

    i'm a newbie in spring and i was following the Developing a Spring Framework MVC application step-by-step tutorial to learn how spring works.

    When i get to part2, i am getting an error when try to open the webapp in the browser.
    I've got the following exception in :
    Code:
    7-Oct-08 3:55:19 PM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring FrameworkServlet 'springapp'
    7-Oct-08 3:55:19 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    java.lang.NoClassDefFoundError: org.springframework.core.CollectionFactory
       at java.lang.Class.initializeClass(libgcj.so.81)
       at org.springframework.core.SimpleAliasRegistry.<init>(SimpleAliasRegistry.java:41)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.<init>(DefaultSingletonBeanRegistry.java:75)
       at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.<init>(FactoryBeanRegistrySupport.java:41)
       at org.springframework.beans.factory.support.AbstractBeanFactory.<init>(AbstractBeanFactory.java:146)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:144)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:155)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.<init>(DefaultListableBeanFactory.java:121)
       at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:176)
       at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:121)
       at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)
       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
       at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
       at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
       at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
       at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
       at javax.servlet.GenericServlet.init(GenericServlet.java:212)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
       at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(libgcj.so.81)
    7-Oct-08 3:55:19 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet springapp
    java.lang.NoClassDefFoundError: org.springframework.core.CollectionFactory
       at java.lang.Class.initializeClass(libgcj.so.81)
       at org.springframework.core.SimpleAliasRegistry.<init>(SimpleAliasRegistry.java:41)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.<init>(DefaultSingletonBeanRegistry.java:75)
       at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.<init>(FactoryBeanRegistrySupport.java:41)
       at org.springframework.beans.factory.support.AbstractBeanFactory.<init>(AbstractBeanFactory.java:146)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:144)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:155)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.<init>(DefaultListableBeanFactory.java:121)
       at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:176)
       at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:121)
       at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)
       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
       at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
       at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
       at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
       at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
       at javax.servlet.GenericServlet.init(GenericServlet.java:212)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
       at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:808)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(libgcj.so.81)
    I'm using jdk6u7 with spring 2.5.5 and tomcat 6.0.18.
    I would appreciate if someone could help me.


    Thank you

  2. #2

    Default

    When I get a NoClassDefFound error like this it generally means I'm either missing one of the Jar files I need, or I've put my Jar files in the wrong place and Tomcat isn't finding them. The particular class that Tomcat isn't finding in your case is in the spring-core.jar file, so make sure you have that one and it's in the right location, registered with your container, etc.

  3. #3
    Join Date
    Oct 2008
    Posts
    5

    Default

    Hi,

    i know that it can't find the jar, but i think that the jar files are in the right place.
    I've put spring.jar, in springapp/war/web-inf/lib, as it is suggested in the tutorial.
    I've also put spring-core.jar just to make sure, and still doesn't work.
    I think that spring-core.jar isn't needed because it's included in spring.jar, right?

    I have no idea why this don't work.

    Thank you

  4. #4
    Join Date
    Oct 2008
    Posts
    5

    Default

    Another thing,

    I've deployed the application in glassfish and it works ok.
    So, tomcat is having a problem in finding the jar file.

    Can anyone help me?
    I will use glassfish for now, but i would like to figure out why it doesn't work with tomcat.

    thank you

Posting Permissions

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