开发者

Starting HornetQ in tomcat

开发者 https://www.devze.com 2023-03-27 12:49 出处:网络
I am trying to start hornetQ 2.0.0.GA in Tomcat. My application, when initializing, will try to start hornetq server in this way:

I am trying to start hornetQ 2.0.0.GA in Tomcat.

My application, when initializing, will try to start hornetq server in this way:

org.jnp.server.Main jndiServer;

jndiServer = new Main()开发者_JAVA百科;

jndiServer.setNamingInfo(naming);

jndiServer.setPort(1099);

jndiServer.setBindAddress("localhost");

jndiServer.setRmiPort(1098);

jndiServer.setRmiBindAddress("localhost");

jndiServer.start();

...

jmsServer = new JMSServerManagerImpl(hornetqServer, jmsConfig);

jmsServer.start();

I need the jndi service started, so that then I can lookup for a ConnectionFactory to integrate it with Bitronix TM.

It runs ok in an standalone test, but when I run it in tomcat,

I get an error in jndiServer.start();

Caused by: java.lang.NullPointerException at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:175) at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293) at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:256) at org.jnp.server.Main.initJnpInvoker(Main.java:462) at org.jnp.server.Main.start(Main.java:422) ... 50 more

Any help?

Thanks,

Demian


I believe there's a method setJNDIContext at the JMSServerManager on HQ 2.0 (since you are instantiating your own context).

On 2.2.5, there's an intermediate interface called BindingRegistry. You can use that to plug your naming context to whatever you want on Tomcat (including JNDI)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号