将应用程序从 Wildfly 迁移到 Apache ServiceMix 5.1

Migrating App form Wildfly to Apache ServiceMix 5.1

我正在尝试将 Java 应用程序从 Wildfly 迁移到 Apache ServiceMix 5.1。该应用程序正在使用 Spring 框架和 Web 服务。每当我部署我的应用程序时,我都会收到以下错误。我将所有依赖项安装到服务器。我可以补充一点,我已经成功迁移了几个使用 Spring 但不使用 Web 服务的应用程序:

15:17:44,282 | ERROR | ExtenderThread-1 | ContextLoaderListener            | 130 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=my-bundle, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/web-services]
Offending resource: URL [bundle://170.4:0/META-INF/spring/spring-config.xml]

                at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:318)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1435)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[215:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]
                at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)[129:org.springframework.osgi.core:1.2.1]
                at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)[129:org.springframework.osgi.core:1.2.1]
                at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[216:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]
                at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)[216:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]
                at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access0(AbstractDelegatedExecutionApplicationContext.java:69)[129:org.springframework.osgi.core:1.2.1]
                at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.run(AbstractDelegatedExecutionApplicationContext.java:269)[129:org.springframework.osgi.core:1.2.1]
                at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[129:org.springframework.osgi.core:1.2.1]
                at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)[129:org.springframework.osgi.core:1.2.1]
                at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)[130:org.springframework.osgi.extender:1.2.1]
                at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)[130:org.springframework.osgi.extender:1.2.1]
                at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)[129:org.springframework.osgi.core:1.2.1]
                at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.run(ContextLoaderListener.java:716)[130:org.springframework.osgi.extender:1.2.1]
                at java.lang.Thread.run(Thread.java:745)[:1.7.0_67]

对我有帮助的是我的 pom.xml 文件中的以下依赖声明:

<dependency>
    <groupId>org.jvnet.jax-ws-commons.spring</groupId>
    <artifactId>jaxws-spring</artifactId>
    <version>1.8</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.sun.xml.stream.buffer</groupId>
            <artifactId>streambuffer</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.jvnet.staxex</groupId>
            <artifactId>stax-ex</artifactId>
        </exclusion>
    </exclusions>
</dependency>