I've 2 projects:
Project A with its spring declaration file a.xml
Project B that uses Project A with its spring declaration file b.xml
If I deploy Project B in an external Tomcat everything works fine but inside STS the only way to run Project B is to close Project A otherwise I get the following error:
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:/a.xml]
Offending resource: ServletContext resource [/WEB-INF/b.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [a.xml]; nested exception is java.io.FileNotFoundException: class path resource [a.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
In the build path of Project B I've added Project A under the tab "Projects" and in the Project B's pom.xml I've referenced Project A with scope "compile".
Any idea on why it happens and how to resolve it?
I'm running STS 3.6.0.
UPDATE: Project A Pom.xml
<groupId>com.mycompany.backend</groupId>
<artifactId>services</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
Project B Pom.xml
<dependency>
<groupId>com.mycompany.backend</groupId>
<artifactId>services</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
Finally in Project B's Spring config file the inclusion of the Project A one is done with:
<import resource="classpath:/a-services-beans.xml"/>
Thanks, Alexio