0

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

Alexio Cassani
  • 269
  • 2
  • 6
  • 19
  • if you have installed the eclipse m2e plugin (normaly shipped with STS), then eclipse should configure the dependencies between the projects by itselfe, after you add them to the pom. A project/update maven configuration should be enogth. Anyway: please post the relevant parts of the pom as well as the spring configuration that is responsible to load the a/b.xml – Ralph Jul 20 '14 at 17:09
  • Try with **classpath*:** you have a * – Manuel Jordan Jul 21 '14 at 02:56
  • With classpath* it works again - thanks! – Alexio Cassani Jul 22 '14 at 12:25

0 Answers0