Activemq代理不在Servicemix 5.3.0中启动

时间:2014-12-17 21:11:46

标签: xml spring activemq apache-servicemix

我创建了以下activemq代理配置,并尝试在servicemix 5.3.0中安装。

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:broker="http://activemq.apache.org/schema/core"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

    <bean
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />

    <broker:broker brokerName="myBroker1" dataDirectory="${karaf.data}/activemq/myBroker1"
        useShutdownHook="false" startAsync="true">

        <broker:destinations>
            <broker:queue physicalName="SOME.QUEUE" />
        </broker:destinations>

        <!-- The transport connectors ActiveMQ will listen to -->
        <broker:transportConnectors>
            <broker:transportConnector name="openwire" uri="tcp://localhost:61617" />
            <broker:transportConnector name="stomp" uri="stomp://localhost:61614" />
        </broker:transportConnectors>

    </broker:broker>

</beans>

我在servicemix 5.3.0日志中收到以下错误

  

2014-12-17 14:03:17,959 |错误| xtenderThread-13 |   ContextLoaderListener | 121 -   org.springframework.osgi.extender - 1.2.1 |应用背景   刷新失败   (OsgiBundleXmlApplicationContext(束= com.att.ebiz.mq-经纪人BROKER1,   配置= osgibundle:/ META-INF /弹簧/ * XML))   org.springframework.beans.factory.BeanDefinitionStoreException:   无法识别的xbean名称空间映射:   http://activemq.apache.org/schema/core at   org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:284)[88:org.apache.xbean.spring:3.16.0]     在   org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)[88:org.apache.xbean.spring:3.16.0]     在   org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)[88:org.apache.xbean.spring:3.16.0]     在   org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[76:org.apache.servicemix.bundles.spring-豆:3.2.9.RELEASE_1]     在   org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)[120:org.springframework.osgi.core:1.2.1]     在   org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)[120:org.springframework.osgi.core:1.2.1]     在   org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[78:org.apache.servicemix.bundles.spring上下文:3.2.9.RELEASE_1]     在   org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)[78:org.apache.servicemix.bundles.spring上下文:3.2.9.RELEASE_1]     在   org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access $ 800(AbstractDelegatedExecutionApplicationContext.java:69)[120:org.springframework.osgi.core:1.2.1]     在   org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext $ 3.run(AbstractDelegatedExecutionApplicationContext.java:269)[120:org.springframework.osgi.core:1.2.1]     在   org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[120:org.springframework.osgi.core:1.2.1]     在   org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)[120:org.springframework.osgi.core:1.2.1]     在   org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)[121:org.springframework.osgi.extender:1.2.1]     在   org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)[121:org.springframework.osgi.extender:1.2.1]     在   org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)[120:org.springframework.osgi.core:1.2.1]     在   org.springframework.osgi.extender.internal.activator.ContextLoaderListener $ 2.run(ContextLoaderListener.java:716)[121:org.springframework.osgi.extender:1.2.1]     在java.lang.Thread.run(Thread.java:745)[:1.7.0_71]

经纪人没有开始。请帮忙。感谢。

2 个答案:

答案 0 :(得分:0)

我找到了问题的解决方案,而不是专门针对错误。我用蓝图和它的工作正常。以下是蓝图经纪人配置

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
    xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
    xmlns:broker="http://activemq.apache.org/schema/core">

    <bean
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />

    <broker:broker brokerName="myBroker1"
        dataDirectory="${karaf.data}/activemq/myBroker1" useShutdownHook="false"
        startAsync="true">
        <broker:destinations>
            <broker:queue physicalName="SOME.QUEUE" />
        </broker:destinations>

        <broker:transportConnectors>
            <broker:transportConnector name="openwire"
                uri="tcp://localhost:61617" />
            <broker:transportConnector name="stomp"
                uri="stomp://localhost:61614" />
        </broker:transportConnectors>
    </broker:broker> </blueprint>

答案 1 :(得分:0)

我们目前在ServiceMix 5.3.x和5.4.x中存在一个问题,但在Karaf 2.4.x(https://issues.apache.org/jira/browse/SM-2414)中缺少Spring Deployer。

作为解决方法,您可以在ServiceMix 5.3.0上手动安装

osgi:install -s mvn:org.apache.karaf.deployer/org.apache.karaf.deployer.spring/2.4.0

以及5.3.1和5.4.0:

osgi:install -s mvn:org.apache.karaf.deployer/org.apache.karaf.deployer.spring/2.4.1

我希望它有所帮助。