找不到部署期间的context.xml

时间:2017-12-19 09:43:56

标签: spring eclipse tomcat deployment

我在eclipsew中有三个Maven项目:

webappserviceimplsoa

webapp项目包含serviceimplsoa项目作为maven依赖项(但是eclipse项目不是jars!)

在eclipse中我可以成功构建应用程序。在eclipse中Tomcat server v7.0部署应用程序时,我收到以下错误:

2017-12-19 09:58:35,591 INFO  info.magnolia.module.ModuleManagerImpl            : Starting module xyzwhatever
Dez 19, 2017 9:58:35 AM org.apache.catalina.core.ApplicationContext log
INFORMATION: Initializing Spring root WebApplicationContext
2017-12-19 09:58:36,070 ERROR org.springframework.web.context.ContextLoader     : Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/xyzwhatever-serviceimpl-context.xml]
Offending resource: class path resource [applicationContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/xyzwhatever-serviceimpl-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/xyzwhatever-serviceimpl-context.xml] cannot be opened because it does not exist

但是当我查找名为JAR的生成的serviceimpl-2.0.0-SNAPSHOT.jar(在Maven构建过程中生成)时,它确实包含META-INF/xyzwhatever-serviceimpl-context.xml。我已经检查了在本地maven存储库JAR中生成的.m2/...以及在应用程序的generated文件夹中生成的xml。两者都包含classpath文件。

那么为什么部署期间会出现错误? otbcli_BandMath -il ${MY_INPUT}_B2.TIF -out B2TOA.TIF -exp "($ml2*im1b1)+$ad2" 有什么问题吗?

1 个答案:

答案 0 :(得分:0)

确定解决方案是:在我的各种xml文件中,我不得不改变:

<import resource="classpath:xyzwhatever-serviceimpl-context.xml"/>

<import resource="classpath*:xyzwhatever-serviceimpl-context.xml"/>

所以明星(*)需要在那里!