On 6/8/07, Raffaele <[EMAIL PROTECTED]> 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/

Reply via email to