users@glassfish.java.net

Problems with remote client sending to JMS topic

From: <forums_at_java.net>
Date: Wed, 6 Jul 2011 14:40:40 -0500 (CDT)

Hi,
I have a simple client that sends a message to a JMS topic, using Glassfish
3.1.
All works well when run on the same machine as the server.
However, when the same client is run on another machine no message is placed
on the queue.
I've attached the client logs. All appears to be well except for the two
stacktraces that are logged as FINE. Not sure if these are affecting the
outcome or not.
So far I've done the following:
1. added -Dorg.omg.CORBA.ORBInitialHost=192.168.1.19 and
-Dorg.omg.CORBA.ORBInitialPort=3700 to client startup where 192.168.1.19 is
the IP of the server
2. added an entry into the client etc/hosts file "192.168.1.19 Glassfish1"
where Glassfish1 is the name of the server
3. added the following to the jndi.properties file
 
 java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
   java.naming.provider.url=iiop://192.168.1.19:3700
   org.omg.CORBA.ORBInitialHost=192.168.1.19
   org.omg.CORBA.ORBInitialPort=3700
   java.naming.factory.url.pkgs=com.sun.enterprise.naming
 
 java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl

4. Tested with firewalls and AV shutdown on both client and server
  From looking at the stacktrace I see the following line that does not look
right.
    imqConnectionURL=http://localhost/imq/tunnel
Should this not reference the server address instead of localhost?
The only other difference is that I am pointing to the contents of the
appclient.jar and not to the glassfish distribution directly. I had to add
imqbroker.jar as that appeared to be missing from appclient.jar.
Would there be anything else missing?
My code is as follows:
    jndiContext = new InitialContext();
    connectionFactory = (ConnectionFactory)
jndiContext.lookup("jms/TopicConnectionFactory");
    topic = (Topic) jndiContext.lookup("jms/ClientTagRequestUpdates");
    connection = connectionFactory.createConnection();
    session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    messageProducer = session.createProducer(topic);
    messageProducer.setTimeToLive(1000);
    message = session.createObjectMessage();
    message.setObject(new ClientRequestDTO());
    messageProducer.send(message)
At this stage I've exhausted my options and I'm stumped. Am I missing
something obvious?
Any help would be greatly appreciated.
Thanks
Stephen
 


--
[Message sent by forum member 'stepheng']
View Post: http://forums.java.net/node/819436