I have a project using the standard Maven web app layout, deployed within Tomcat 8.5 in Eclipse Photon (with latest updates).
Inside of src\main\webapp\WEB-INF\applicationContext.xml
, there is an <import resource="classpath:/other-spring-stuff.xml" />
I verified the other-spring-stuff.xml
which is normally sitting in src/main/resources
, appears in the root of the WAR
generated by mvn install
.
But when trying to run the app in Tomcat within Eclipse, I get:
20:37:17 SEVERE: Servlet [servletSpringDispatcher] in web application [/myapp] threw load() exception - 2018-08-27 @{org.apache.catalina.core.StandardContext loadOnStartup}
java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:227)
I don't really know whether this is a problem with Maven, Eclipse, or Spring.
What can cause this? This is actually in a project that was working fine until yesterday, and nothing changed on the project configuration.