部署到Fuse ESB时,Spring的版本不兼容(ServiceMix 4.4.1-fuse-03-06)

时间:2012-05-08 21:47:27

标签: maven osgi apache-servicemix

我的问题是如何强制捆绑包使用与其一起打包的Spring版本而不是ESB上安装的版本?

我有一个简单的Webservices WAR,我试图安装并在Fuse ESB中启动。 WAR依赖于Spring 3.0.6,我在ESB中安装了Spring 3.0.5功能。安装并尝试启动捆绑包后,我收到以下错误。

22:24:43,869 |错误| l Console Thread | 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资源[/WBB-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上。我原以为bundle应该只在bundle 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>

1 个答案:

答案 0 :(得分:0)

bundle classpath由MANIFEST.MF的Import-Packages定义,而不是/ lib文件夹。您可能需要配置Maven-Bundle-Plugin以使用Spring 3.0.6。

相关问题