Announcement Announcement Module
Collapse
No announcement yet.
ClassNotFoundException in STS when running pizzashop reference app Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassNotFoundException in STS when running pizzashop reference app

    I followed the steps in the pizzashop demo (http://static.springsource.org/sprin...beginning.html). I followed all the step thru section 2.9 and have run into a problem. I am able to successfully run the application outside of STS using 'mvn tomcat:run', however, when I attempt to deploy the application to a local Tomcat v6 server from within STS and I get the following error:

    Code:
    SEVERE: StandardWrapper.Throwable
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'applicationConversionService' while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.tcbakes.sample.pizzashop.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: com.tcbakes.sample.pizzashop.web.ApplicationConversionServiceFactoryBean
    Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.tcbakes.sample.pizzashop.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: com.tcbakes.sample.pizzashop.web.ApplicationConversionServiceFactoryBean
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    When I explore my workspace's '.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/sample_pizza/WEB-INF/classes' folder (which I am pretty sure is where my application's resources are), I don't see any class files, just 'alt.properties' and 'standard.properties'. That's a problem, right?

    Anyway, any advice would be greatly appreciated.

  • #2
    I've been poking around a little more at this and eventually solved it by deleting the project from STS, then removing all of the .classpath, .settings and .project files from the file system and then re-importing the project into STS (Import...>Existing Maven Project).

    Not sure what happened the first time around but this time the '.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/sample_pizza/WEB-INF/classes' folder contains all of my class files and resources. The issue seems to be with the Import operation that somehow hiccuped during the import process. If I figure out how to reproduce this, I will post again with more info.
    Last edited by tcbakes; Mar 28th, 2012, 11:40 AM.

    Comment


    • #3
      Hey!

      Good to hear its working now and thanks for letting us know!!!

      Cheers,
      -Martin

      Comment

      Working...
      X