【发布时间】:2012-05-17 10:25:42
【问题描述】:
我的问题是如何强制捆绑使用与其打包的 Spring 版本而不是 ESB 上安装的版本?
我有一个简单的 Webservices WAR,我正在尝试在 Fuse ESB 中安装和启动它。 WAR 依赖于 Spring 3.0.6,我在 ESB 中安装了 Spring 3.0.5 功能。安装并尝试启动捆绑包后出现以下错误。
22:24:43,869 |错误 | l 控制台线程 | RegisterWebAppVisitorWC | 163 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 |注册异常。跳过。 org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法从 URL 位置导入 bean 定义 [classpath:META-INF/spring/app-context.xml] 违规资源:ServletContext资源[/WEB-INF/cxf-servlet.xml];嵌套异常是 org.springframework.beans.factory.BeanDefinitionStoreException:从类路径资源 [META-INF/spring/app-context.xml] 解析 XML 文档时出现意外异常;嵌套异常是 org.springframework.beans.FatalBeanException:命名空间 [http://www.springframework.org/schema/jdbc] 的类 [org.springframework.jdbc.config.JdbcNamespaceHandler] 没有实现 [org.springframework.beans .factory.xml.NamespaceHandler] 接口 在 org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[73:org.springframework.beans:3.0.5.RELEASE]
这表明正在使用意外版本的 Spring。我可以看到 3.0.6 在 Bundle-Classpath 上。我原以为捆绑应该只使用捆绑 lib 文件夹中的 Spring 版本。
我也有这个 pom 配置,以便在将 WAR 部署到 ServiceMix 时将 Maven 依赖项包含在类路径中。
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<classpathLayoutType>repository</classpathLayoutType>
</manifest>
</archive>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
<webResources>
<resource>
<directory>src/main/resources</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>**.*</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
【问题讨论】:
标签: maven osgi apache-servicemix