users@glassfish.java.net

Embedded JMS not starting automatically

From: <glassfish_at_javadesktop.org>
Date: Tue, 13 Jul 2010 09:46:03 PDT

Hi all

I'm in the process of swapping my applications over from ActiveMQ to the embedded messaging in Glassfish (OpenMQ)

I'm running into an issue with the embedded glassfish messaging.
I have Glassfish(Ver 3.0.1) installed as a service,and my settings for the embedded JMS are as follows:
      <jms-service default-jms-host="Publisher_Host" type="EMBEDDED">
            <jms-host host="localhost" name="default_JMS_host" lazy-init="true" />
            <jms-host port="3545" host="inhouse" name="Publisher_Host" admin-password="aPassword" />
      </jms-service>

When trying to Connect to the embedded JMS from my client application I get the following error message:
[C4003]: Error occurred on connection creation [inhouse:3545]. - cause: java.net.ConnectException: Connection refused:

By using the asadmin jms-ping command or by going in via the web frontend and using the 'ping button' the embedded JMS seems to initialize and start accepting connections.

What I have tried to do is use the lazy-init property as defined in the "default_JMS_host" ie:

      <jms-service default-jms-host="Publisher_Host" type="EMBEDDED">
            <jms-host host="localhost" name="default_JMS_host" lazy-init="true" />
            <jms-host port="3545" host="inhouse" name="Publisher_Host" admin-password="aPassword" [b]lazy-init="false"[/b] />
      </jms-service>

To make it initalise when glassfish starts up, but this doesn't seem to make a difference.

What I think is happening is that Glassfish is waiting for an 'embedded application' to call the JMS before initialising, however at this time I am not using glassfish to host the applications, merely for its Message Queue. (We plan to use more of Glassfish moving forward, but this is our first step)

How can I make the embedded JMS start up when glassfish starts?

Thanks
Tim
[Message sent by forum member 'timsa']

http://forums.java.net/jive/thread.jspa?messageID=477530