book
Article ID: KB0087202
calendar_today
Updated On:
Description
Resolution:
If you are performing a JNDI lookup, the ConnectionFactory should then include the fully qualify name.
For example, let's say that the QueueConnectionFactory is defined like this in the EMS Server:
From the tibemsadmin tool:
show factory QueueConnectionFactory
Factory: = QueueConnectionFactory
JNDI names: "QueueConnectionFactory"
URL = tcp://7222
ClientID =
Then, when an application performs a JNDI lookup on the connection factory, EMS Server will return tcp://<EMS Server hostname>:7222.
The hostname will be the value returned by the system call to gethostbyname(). The hostname will be the one that is printed in the EMS Server startup banner.
When this ConnectionFactory is returned to a remote client and then the client creates a Connection based on that ConnectionFactory, it will use the URL from the ConnectionFactory. If, on this machine, the "short hostname" is not resolved, then that will fail.
To solve this issue, modify the ConnectionFactory URL in the server to include the correct hostname.
From the admin tool:
setprop factory QueueConnectionFactory url=tcp://<hostname>:7222
Issue/Introduction
We sometimes get an error message like "'Failed to connect to the server at tcp://myhost1234:7222'.