activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré>
Subject OSGi dependency in ActiveMQ 5.3.2
Date Mon, 28 Jun 2010 07:27:40 GMT
Hi all,

as you know, ActiveMQ is used in ServiceMix as default message broker.

ServiceMix 3.3.x uses Spring configuration and loads the ActiveMQ bean 
in activemq.xml Spring file:

<beans xmlns:amq="">
   <!-- ActiveMQ JMS Broker configuration -->
   <amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false">

     <!-- Disable creation of the jmx connector
          which is created in the jmx.xml configuration file -->
       <bean class="">
         <property name="createConnector" value="false" />

     <!-- Use AMQ Message Store as default broker persistence adapter -->
       <amq:amqPersistenceAdapter directory="file:./data/amq"/>

       <!-- Examples for journaledJDBC if JDBC is required -->
       <amq:journaledJDBC journalLogFiles="5" dataDirectory="./data/amq"/>
       <amq:journaledJDBC journalLogFiles="5" dataDirectory="../data" 

        <!-- Activate a TCP connector with multicast discovery.
             Note that multicast may be disabled if your computer
             is not on a network, which may prevent the broker to start.
             In such a case, just remove the discoveryUri attribute.
        <amq:transportConnector uri="tcp://localhost:61616" 

       <!-- by default just auto discover the other brokers -->
       <amq:networkConnector uri="multicast://default"/>



Up to ActiveMQ 5.3.1, we didn't encounter any issue with that.

But now, I updated ServiceMix 3.3.x to use ActiveMQ 5.3.2 and I got the 
following at startup:

Caught: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'broker' defined in class path resource 
[activemq.xml]: Instantiation of bean failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Could not 
instantiate bean class [org.apache.activemq.xbean.XBeanBrokerService]: 
Constructor threw exception; nested exception is 
java.lang.NoClassDefFoundError: org/osgi/framework/BundleException

It looks like ActiveMQ 5.3.2 bean now have a dependency to OSGi framework.

As ServiceMix 3.3.x doesn't use OSGi at all (pure Spring), I'm not very 
pleased to add OSGi framework in the distribution classpath.

Moreover, for ActiveMQ, I think that this dependency is not very 
flexible for users that use ActiveMQ "outside" OSGi.

Is it possible to define this dependency as an optional one ?
What do you think ?

FYI, I raise the following Jira task about this:


View raw message