Announcement Announcement Module
No announcement yet.
Embedded activemq broker Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Embedded activemq broker

    We are currently porting the latest version of our product to S2AP and came accross a problem with the activemq bundle when attempting to run an embedded activemq borker

    <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean ">
    <property name="config" value="classpath:broker.xml" />
    <property name="start" value="true" />

    Caused by: com.springsource.platform.osgi.framework.PlatformC lassNotFoundException: org.apache.xbean.spring.context.v1.XBeanXmlBeanDef initionReader in PlatformBundleClassLoader: [ 3.0]
    at com.springsource.platform.osgi.framework.equinox.P latformBundleClassLoader.loadClass(PlatformBundleC
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.xbean.spring.context.impl.XBeanHelper.c reateBeanDefinitionReader(
    ... 28 more
    Caused by: java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v1.XBeanXmlBeanDef initionReader
    at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClassInternal(
    at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(
    at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(
    at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(
    at com.springsource.platform.osgi.framework.equinox.P latformBundleClassLoader.loadClass(PlatformBundleC
    ... 33 more

    It appears that when the BrokerFactoryBean cannot execute the code Class.forName("org.springframework.core.AttributeA ccessorSupport");

    When I add the import for org.springframework.core this problem goes away and I get

    Caused by: org.springframework.beans.factory.BeanDefinitionSt oreException: Unrecognized xbean namespace mapping:
    at org.apache.xbean.spring.context.v2c.XBeanNamespace Handler.parseBeanFromExtensionElement(XBeanNamespa
    at org.apache.xbean.spring.context.v2c.XBeanNamespace Handler.parse(
    at org.apache.xbean.spring.context.v2.XBeanNamespaceH andler.parse(

    We have worked around this problem for now by adding a Dynamic-Import: * to the manifest. Is this a knows issue? I have hunted through the discussion with no luck

  • #2
    Embedded activemq broker

    I would love to hear if anyone has had success with this, this is something we want to use/do as well.


    • #3
      Embedded activemq broker

      The use of Class.forName is certainly a problem - it is unlikely to work correctly in OSGi. I would recommend not using BrokerFactoryBean, instead create the Broker manually.



      • #4
        Embedded activemq broker

        I usually leverage the Spring-friendly factories in ActiveMQ for boostrapping embedded brokers. Here is a simple embedded broker:

        <bean name="amqConnectionFactory" class="org.apache.activemq.spring.ActiveMQConnecti onFactory">
        <property name="brokerURL" value="vm://localhost"/>

        Check the org.apache.activemq.spring package for more information.