activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Embedded Broker - configuration via Java
Date Fri, 08 Jun 2007 09:40:58 GMT
On 6/8/07, Raffaele <r.gambelli@prismasw.it> wrote:
>
> Hi all,
>
> I'm trying to create, configure and launch a broker all in one class.
>
> I have a ClassNotFoundException executing the following lines:
>
> BrokerService broker = new BrokerService();
> broker.addConnector("tcp://localhost:61616");
> broker.start();
>
> And the exception thrown by addConnector(...) is this:
>
> java.lang.NoClassDefFoundError:
> javax/management/MalformedObjectNameException
>         at
> org.apache.activemq.broker.BrokerService.getManagementContext(BrokerService.java:696)
>         at
> org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1265)
>         at
> org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1209)
>         at
> org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
>         at
> org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:163)
>         at
> org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:153)
>         at pss.jms.EmbeddedBroker.main(EmbeddedBroker.java:49)
>
> In my simple test project I'm including only the apache-activemq-4.*.jar
> found in the activemq home directory.
> 1) Which other jar should I include?

Looks like you also need JMX - or Java 5 (which comes with JMX). You
could just disable JMS via broker.setUseJmx(false).


> 2) Is there a page on your confluence where it is explained how to configure
> a broker ALL using only Java without any xml and without Spring?

http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html

further configuration options can be seen on the BrokerService javadoc
http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html

-- 
James
-------
http://macstrac.blogspot.com/

Mime
View raw message