Thank for your answer. By URI, I can't use "AuthenticationUser" ActiveMQ plugin to have authentification on my broker. Isn't it ?
I think I can use xbean URI scheme but I don't want to use xml file, just java code but maybe it's not possible ? Le 28/05/2013 16:45, Romain Manni-Bucau [via OpenEJB] a écrit : > TomEE needs the broker, you can just reference your own broker using a > remote url. isn't it enough? > > > > *Romain Manni-Bucau* > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* > *Blog: > **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* > *Github: https://github.com/rmannibucau* > > > > 2013/5/28 pierrepinon <[hidden email] > </user/SendEmail.jtp?type=node&node=4663276&i=0>> > > > 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. > > > > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the > discussion below: > http://openejb.979440.n4.nabble.com/Tomee-Embedded-Use-custom-broker-tp4663269p4663276.html > > > To unsubscribe from Tomee-Embedded : Use custom broker, click here > <http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4663269&code=cHBpbm9uQHNtYWV1ci5ldXw0NjYzMjY5fC0xMTg2NzY4OTcx>. > NAML > <http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > > -- View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Embedded-Use-custom-broker-tp4663269p4663301.html Sent from the OpenEJB User mailing list archive at Nabble.com.
