dev@glassfish.java.net

Re: Sending JMS messages between systems doesn't work any more

From: Kim Haase <Camilla.Haase_at_Sun.COM>
Date: Thu, 03 Dec 2009 11:38:24 -0500

On 12/03/09 06:20, Nigel Deakin wrote:
> Kim,
>
> Kim Haase wrote:
>> JMS applications that send messages from one system to another stopped
>> working for me in b73 and also fail in b74. They worked in earlier
>> builds -- I think I last tested them around b69.
>>
>> Several examples in the Java EE Tutorial are based on sending JMS
>> messages between systems, so this is an issue for docs.
>>
>> For a number of releases, the way to enable the sending of messages to
>> a remote system has been to create a JMS connection factory resource
>> whose AddressList property is set to the name of the remote system.
>> (The connector connection pool, therefore, has its AddressList
>> property set to this value.)
>>
>> Now, when I try to send messages to the remote system, I get the
>> following error over and over:
>>
>> WARNING: [C4003]: Error occurred on connection creation [jdench:7676].
>> - cause: java.net.ConnectException: Connection refused: connect
>> Dec 2, 2009 11:31:55 AM
>> com.sun.messaging.jmq.jmsclient.ExceptionHandler throwConnectionException
>
> This means it is trying to connect to a MQ broker running on machine
> jdench on port 7676, and it is getting no response, perhaps because the
> broker isn't running or it is using a different port.
>
> Can you connect to it using other tools on your windows machine, such as
> imqcmd (which is in the mq/bin directory of a Glassfish V3 installation)?
>
> For example this command lists the destinations on the broker:
> imqcmd list dst -b jdench:7676
> (it will prompt for user and password: typically admin/admin)

Thanks, Nigel. The broker is running on jdench at port 7676 -- these are
the server log messages on jdench, which look the way they always do:

[#|2009-12-03T11:12:59.008-0500|INFO|glassfishv3.0|javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions|_ThreadID=17;_ThreadName=Thread-1;|JTS5014:
Recoverable JTS instance, serverId = [3700]|#]

[#|2009-12-03T11:13:03.745-0500|INFO|glassfishv3.0|com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter|_ThreadID=32;_ThreadName=Thread-1;|JMS
Service Connection URL is :mq://localhost:7676/|#]

[#|2009-12-03T11:13:03.878-0500|INFO|glassfishv3.0|org.hibernate.validator.engine.resolver.DefaultTraversableResolver|_ThreadID=32;_ThreadName=Thread-1;|Instantiated
an instance of
org.hibernate.validator.engine.resolver.JPATraversableResolver.|#]

[#|2009-12-03T11:13:04.170-0500|INFO|glassfishv3.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=32;_ThreadName=Thread-1;|MQJMSRA_RA1101:
SJSMQ JMS Resource Adapter starting: DIRECT|#]

[#|2009-12-03T11:13:14.151-0500|INFO|glassfishv3.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=32;_ThreadName=Thread-1;|MQJMSRA_RA1101:
SJSMQ JMSRA Started:DIRECT|#]

[#|2009-12-03T11:13:20.619-0500|INFO|glassfishv3.0|javax.resourceadapter.mqjmsra.outbound.connection|_ThreadID=30;_ThreadName=Thread-1;|MQJMSRA_MF1101:
setAddressList:NOT setting default value=localhost|#]

[#|2009-12-03T11:13:20.633-0500|INFO|glassfishv3.0|javax.resourceadapter.mqjmsra.outbound.connection|_ThreadID=30;_ThreadName=Thread-1;|MQJMSRA_MF1101:
setPassword:NOT setting default value|#]

[#|2009-12-03T11:13:20.634-0500|INFO|glassfishv3.0|javax.resourceadapter.mqjmsra.outbound.connection|_ThreadID=30;_ThreadName=Thread-1;|MQJMSRA_MF1101:
setUserName:NOT setting default value=guest|#]

I ran the imqcmd on jdench and after some experimentation I found that
the correct username and password were admin/admin.

  jdench 52 =>imqcmd list dst
Username: admin
Password:
Listing all the destinations on the broker specified by:

-------------------------
Host Primary Port
-------------------------
localhost 7676

---------------------------------------------------------------------------
     Name Type State Producers Consumers Msgs

                                             Total Count UnAck Avg Size
---------------------------------------------------------------------------
PhysicalQueue Queue RUNNING 0 1 0 0 0.0
mq.sys.dmq Queue RUNNING 0 0 0 0 0.0

Successfully listed destinations.

  jdench 53 =>pwd
/home/chaase/glassfish-v3-b74/mq/bin

However, the imqcmd on the Windows system fails:

C:\Program Files\glassfish-v3-b74\mq\bin>imqcmd list dst -b jdench:7676
Username: admin
Password: admin
Listing all the destinations on the broker specified by:

----------------------
Host Primary Port
----------------------
jdench 7676

Dec 3, 2009 11:19:40 AM com.sun.messaging.jmq.jmsclient.ExceptionHandler
throwConnectionException
WARNING: [C4003]: Error occurred on connection creation [jdench:7676]. -
cause:
java.net.ConnectException: Connection refused: connect
Error while connecting to the broker on host 'jdench' and port '7676'.
com.sun.messaging.jms.JMSException: [C4003]: Error occurred on
connection creation [jdench:7676]. - cause: java.net.ConnectException:
Connection refused: connect
Please verify that there is a broker running on the specified host and
port or use the '-b' option to specify the correct broker host and port.

Listing destinations failed.

I notice that on Windows the password shows up in clear text, whereas on
Solaris it doesn't appear. Hard to believe that makes a difference, though.

And I can still ping jdench, save files to it, etc. from my Windows system.

Kim

>
> Nigel
>
>>
>> The JMS service is running on jdench.
>>
>> This probably has nothing to do with it, but I also notice that when
>> JMS started up on the system named jdench, it reported that its
>> connection URL had the :mq: prefix:
>>
>> [#|2009-12-02T11:27:54.660-0500|INFO|glassfishv3.0|com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter|_ThreadID=28;_ThreadName=p:
>> thread-pool-1; w: 5;|JMS Service Connection URL is
>> :mq://localhost:7676/|#]
>
> When the MQ broker (the JMS service) starts, you will see this message:
>
> MQJMSRA_RA1101: SJSMQ JMS Resource Adapter starting: DIRECT (or LOCAL).
>
> Note that in Glassfish 3 the broker isn't started when the Glassfish
> server starts, but is started lazily, so you may not see this message
> until when the first client (either your own app or imqcmd) tries to
> connect to it.
>
>>
>> Or do I have to do something explicit now to allow other systems to
>> connect to the JMS running on GlassFish?
>>
>
> No...
>
> Nigel
>
>> I'm running the client on my Windows XP system, and the remote system
>> (jdench) is my Solaris 10 system. I can ping jdench from the Windows
>> system just fine. The problem happens whether I run the client from
>> NetBeans or from the command line.
>>
>> Thanks,
>> Kim Haase
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>