caused by:java.io.FileNotFoundException:Could not open ServletContext resource [/web-inf/classes/ Applicationcontext.xml] at
Org.springframework.web.context.support.ServletContextResource.getInputStream ( servletcontextresource.java:140) at
Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (Xmlbeandefinitionreader.java : 328) ...
More
The cause of the error occurred in the Web.xml configuration issue:
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class> Org.springframework.web.servlet.dispatcherservlet</servlet-class>
<load-on-startup>1</ load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</ servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Plus:
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class> org.springframework.web.servlet.dispatcherservlet</servlet-class>
<init-param>
< Param-name>contextconfiglocation</param-name>
<param-value>/web-inf/classes/ applicationcontext.xml</param-value>
</init-param>
<load-on-startup>1</ load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</ servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
The problem is that the default profile location that loads spring is typically a applicationcontext.xml file under/web-inf/, and the ApplicationContext file that is automatically generated by the eclipse file is placed in the/web-inf/ Classes/applicationcontext.xml, so the Applicationcontext.xml file cannot be found in the default load and must be added to the configuration above.