Hi everybody,

I would like to use ActiveMQ with Tomee Embedded.
I don't want to use default Broker because I would like to have
authentification on my broker.

For that I launch my broker manually before start TomEE Container like this
:

BrokerService broker = new BrokerService();
broker.setDataDirectory(BROKER_PATH);

AuthenticationUser authenticationUser = new AuthenticationUser(BROKER_USER,
BROKER_PASSWORD, BROKER_GROUPS);

List<AuthenticationUser> users = new ArrayList<AuthenticationUser>();
users.add(authenticationUser);

SimpleAuthenticationPlugin simpleAuthenticationPlugin = new
SimpleAuthenticationPlugin(users);

broker.setPlugins(new BrokerPlugin[] { simpleAuthenticationPlugin });

After I configure TomEE to use external Broker like this (Doc : 
http://tomee.apache.org/jms-resources-and-mdb-container.html) :

properties.put("jmsra", "new://Resource?type=ActiveMQResourceAdapter");
properties.put("jmsra.ServerUrl", "tcp://localhost:61616");
properties.put("jmsra.BrokerXmlConfig", "");
properties.put("jmsra.userName", BROKER_USER);
properties.put("jmsra.password", BROKER_PASSWORD);

properties.put("JmsXA", "new://Resource?type=javax.jms.ConnectionFactory");
properties.put("JmsXA.ResourceAdapter", "jmsra");

properties.put("MyJmsMdbContainer", "new://Container?type=MESSAGE");
properties.put("MyJmsMdbContainer.ResourceAdapter", "jmsra");

properties.put("IncomingMessageQueue",
"new://Resource?type=javax.jms.Queue");
properties.put("InvalidMessageQueue",
"new://Resource?type=javax.jms.Queue");
properties.put("OutgoingMessageQueue",
"new://Resource?type=javax.jms.Queue");

I set BrokerXmlConfig == "" to specified that Tomee not start internal
broker but it try to start his own broker :

GRAVE: Failed to start ActiveMQ
java.lang.NullPointerException
        at org.apache.openejb.util.URLs.uri(URLs.java:105)
        at
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java:126)
        at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1847)
        at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:434)
        at 
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:353)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:147)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:292)
        at 
org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:233)
        at fr.xesnet.test.testTomeeEmbedded.Container.start(Container.java:265)
        at fr.xesnet.test.testTomeeEmbedded.Tomee.startTomEE(Tomee.java:147)
        at fr.xesnet.test.testTomeeEmbedded.Tomee.start(Tomee.java:64)
        at fr.xesnet.test.testTomeeEmbedded.Main$2.run(Main.java:36)

I don't understand why...

Any suggestion ?

Thank a lot



--
View this message in context: 
http://openejb.979440.n4.nabble.com/Tomee-Embedded-Use-custom-broker-tp4663269.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to