SpringとのMavenプロジェクトがあります。クラスパスにjarとしてバックエンドプロジェクトがあります(maven依存関係として追加されました)。バックエンドプロジェクトは再びSpringを使用しており、独自のapplicationContext.xmlがあります。フロントエンドプロジェクトにはapplicationContext.xmlがあり、次のようにバックエンドからアプリケーションコンテキストにアクセスしたいと思います。
<import resource="classpath:applicationContext.xml" />
しかし、私は得ました:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:applicationContext.xml]
Offending resource: ServletContext resource [/WEB-INF/appContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
また試した:
<import resource="classpath*:applicationContext.xml" />
と
<import resource="classpath:/applicationContext.xml" />