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

Maven 部署到Fuse ESB时Spring版本不兼容(ServiceMix 4.4.1-Fuse-03-06),maven,osgi,apache-servicemix,Maven,Osgi,Apache Servicemix,我的问题是,如何强制捆绑包使用与其打包的Spring版本,而不是ESB上安装的版本 我有一个简单的webserviceswar,我正试图在fuseesb中安装并启动它。WAR依赖于Spring3.0.6,我在ESB中安装了Spring3.0.5特性。在安装并尝试启动捆绑包后,我发现以下错误 22:24:43869 |错误| l控制台线程| RegisterWebAppVisitorWC | 163-org.ops4j.pax.web.pax-web-extender-war-1.0.3 |注册异

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

我有一个简单的webserviceswar,我正试图在fuseesb中安装并启动它。WAR依赖于Spring3.0.6,我在ESB中安装了Spring3.0.5特性。在安装并尝试启动捆绑包后,我发现以下错误

22:24:43869 |错误| l控制台线程| RegisterWebAppVisitorWC | 163-org.ops4j.pax.web.pax-web-extender-war-1.0.3 |注册异常。跳过 org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法从URL位置[classpath:META-INF/spring/app-context.xml]导入bean定义 有问题的资源:ServletContext资源[/WEB-INF/CXFServlet.xml];嵌套异常为org.springframework.beans.factory.BeanDefinitionStoreException:解析类路径资源[META-INF/spring/app-context.XML]中的XML文档时发生意外异常;嵌套异常是org.springframework.beans.FatalBeanException:命名空间的类[org.springframework.jdbc.config.JdbcNamespaceHandler][http://www.springframework.org/schema/jdbc]未实现[org.springframework.beans.factory.xml.NamespaceHandler]接口 位于org.springframework.beans.factory.parsing.FailFastProblemReporter.ErrorFailFailFastProblemReporter.java:68[73:org.springframework.beans:3.0.5.RELEASE]

这表明正在使用一个意外版本的Spring。我可以看到3.0.6在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>

bundle类路径由MANIFEST.MF中的导入包定义,而不是由/lib文件夹定义。您可能需要将配置为使用Spring 3.0.6。

好的,谢谢,我可以改为使用maven bundle插件,我确信这是将服务部署到ESB中的正确方法。不过,我想探讨如何将打包和安装作为WAR,因为Fuse确实提供了这一功能。