views:

186

answers:

1

Trying to set up a new spring project and im having this issue where I get this error (HTTP Status 404 - Servlet newspring is not available) when I navigate to a page that I expect to get routed through to a controller.

web.xml

<servlet> 
 <servlet-name>springapp</servlet-name>
 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
 <load-on-startup>1</load-on-startup>
</servlet> 

<servlet-mapping> 
 <servlet-name>springapp</servlet-name> 
 <url-pattern>/app/*</url-pattern> 
</servlet-mapping>

So I looked in the tomcat logs and I see this exception:

SEVERE: Error loading WebappClassLoader delegate: false
repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@a1807c org.springframework.web.servlet.DispatcherServlet java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)

but the supposedly missing class is actually present in the spring-webmvc.jar which is present in the WEB-INF/libs(at tomcatfolder/webapp/newSpring/WEB-INF/libs).

Is it unable to look here ?

+2  A: 

Assuming I read correctly, the folder should be /WEB-INF/lib, not /WEB-INF/libs - note the lack of s at the end!

Esko