Results 1 to 4 of 4

Thread: Embedded activemq broker

  1. #1
    Join Date
    Oct 2008
    Posts
    0

    Default 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" />
    </bean>

    Caused by: com.springsource.platform.osgi.framework.PlatformC lassNotFoundException: org.apache.xbean.spring.context.v1.XBeanXmlBeanDef initionReader in PlatformBundleClassLoader: [bundle=com.springsource.org.apache.xbean.spring_3. 3.0]
    at com.springsource.platform.osgi.framework.equinox.P latformBundleClassLoader.loadClass(PlatformBundleC lassLoader.java:136)
    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(XBeanHelper.java:44)
    ... 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(BundleLoader.java:481)
    at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:397)
    at org.eclipse.osgi.framework.internal.core.BundleLoa der.findClass(BundleLoader.java:385)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:87)
    at com.springsource.platform.osgi.framework.equinox.P latformBundleClassLoader.loadClass(PlatformBundleC lassLoader.java:134)
    ... 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: http://activemq.apache.org/schema/core
    at org.apache.xbean.spring.context.v2c.XBeanNamespace Handler.parseBeanFromExtensionElement(XBeanNamespa ceHandler.java:270)
    at org.apache.xbean.spring.context.v2c.XBeanNamespace Handler.parse(XBeanNamespaceHandler.java:157)
    at org.apache.xbean.spring.context.v2.XBeanNamespaceH andler.parse(XBeanNamespaceHandler.java:49)

    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. #2
    Join Date
    Oct 2008
    Posts
    0

    Default 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. #3
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default 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.

    Rob

  4. #4
    Join Date
    Oct 2008
    Posts
    0

    Default 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"/>
    </bean>

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •