You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Jean-Baptiste Onofré <jb...@nanthrax.net> on 2010/06/28 09:27:40 UTC
OSGi dependency in ActiveMQ 5.3.2
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="http://activemq.apache.org/schema/core">
<!-- 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 -->
<amq:managementContext>
<bean class="org.apache.activemq.broker.jmx.ManagementContext">
<property name="createConnector" value="false" />
</bean>
</amq:managementContext>
<!-- Use AMQ Message Store as default broker persistence adapter -->
<amq:persistenceAdapter>
<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"
dataSource="#postgres-ds"/>
-->
</amq:persistenceAdapter>
<amq:transportConnectors>
<!-- 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"
discoveryUri="multicast://default"/>
</amq:transportConnectors>
<amq:networkConnectors>
<!-- by default just auto discover the other brokers -->
<amq:networkConnector uri="multicast://default"/>
<!--
<amq:networkConnector
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
-->
</amq:networkConnectors>
</amq:broker>
</beans>
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:
https://issues.apache.org/activemq/browse/SM-1958
Thanks
Regards
JB
Re: OSGi dependency in ActiveMQ 5.3.2
Posted by Gary Tully <ga...@gmail.com>.
Think this dependency was introduced by
https://issues.apache.org/activemq/browse/AMQ-2574 that was reopened so the
fix can be reworked to make the dependency optional.
On 28 June 2010 08:27, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 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="http://activemq.apache.org/schema/core">
> <!-- 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 -->
> <amq:managementContext>
> <bean class="org.apache.activemq.broker.jmx.ManagementContext">
> <property name="createConnector" value="false" />
> </bean>
> </amq:managementContext>
>
> <!-- Use AMQ Message Store as default broker persistence adapter -->
> <amq:persistenceAdapter>
> <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"
> dataSource="#postgres-ds"/>
> -->
> </amq:persistenceAdapter>
>
> <amq:transportConnectors>
> <!-- 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"
> discoveryUri="multicast://default"/>
> </amq:transportConnectors>
>
> <amq:networkConnectors>
> <!-- by default just auto discover the other brokers -->
> <amq:networkConnector uri="multicast://default"/>
> <!--
> <amq:networkConnector
> uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
> -->
> </amq:networkConnectors>
>
> </amq:broker>
>
> </beans>
>
> 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:
> https://issues.apache.org/activemq/browse/SM-1958
>
> Thanks
> Regards
> JB
>
--
http://blog.garytully.com
Open Source Integration
http://fusesource.com
Re: OSGi dependency in ActiveMQ 5.3.2
Posted by Guillaume Nodet <gn...@gmail.com>.
Yes, it should be optional and I don't think anyone knowingly added
this dependency. The thing i don't really get is how activemq can be
used standalone if there is such a mandatory dependency (I don't think
the activemq distribution comes with osgi afaik).
On Mon, Jun 28, 2010 at 09:27, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 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="http://activemq.apache.org/schema/core">
> <!-- 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 -->
> <amq:managementContext>
> <bean class="org.apache.activemq.broker.jmx.ManagementContext">
> <property name="createConnector" value="false" />
> </bean>
> </amq:managementContext>
>
> <!-- Use AMQ Message Store as default broker persistence adapter -->
> <amq:persistenceAdapter>
> <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"
> dataSource="#postgres-ds"/>
> -->
> </amq:persistenceAdapter>
>
> <amq:transportConnectors>
> <!-- 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"
> discoveryUri="multicast://default"/>
> </amq:transportConnectors>
>
> <amq:networkConnectors>
> <!-- by default just auto discover the other brokers -->
> <amq:networkConnector uri="multicast://default"/>
> <!--
> <amq:networkConnector
> uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
> -->
> </amq:networkConnectors>
>
> </amq:broker>
>
> </beans>
>
> 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:
> https://issues.apache.org/activemq/browse/SM-1958
>
> Thanks
> Regards
> JB
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: OSGi dependency in ActiveMQ 5.3.2
Posted by Guillaume Nodet <gn...@gmail.com>.
Yes, it should be optional and I don't think anyone knowingly added
this dependency. The thing i don't really get is how activemq can be
used standalone if there is such a mandatory dependency (I don't think
the activemq distribution comes with osgi afaik).
On Mon, Jun 28, 2010 at 09:27, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 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="http://activemq.apache.org/schema/core">
> <!-- 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 -->
> <amq:managementContext>
> <bean class="org.apache.activemq.broker.jmx.ManagementContext">
> <property name="createConnector" value="false" />
> </bean>
> </amq:managementContext>
>
> <!-- Use AMQ Message Store as default broker persistence adapter -->
> <amq:persistenceAdapter>
> <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"
> dataSource="#postgres-ds"/>
> -->
> </amq:persistenceAdapter>
>
> <amq:transportConnectors>
> <!-- 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"
> discoveryUri="multicast://default"/>
> </amq:transportConnectors>
>
> <amq:networkConnectors>
> <!-- by default just auto discover the other brokers -->
> <amq:networkConnector uri="multicast://default"/>
> <!--
> <amq:networkConnector
> uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
> -->
> </amq:networkConnectors>
>
> </amq:broker>
>
> </beans>
>
> 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:
> https://issues.apache.org/activemq/browse/SM-1958
>
> Thanks
> Regards
> JB
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com