I have a code fragment (shown below) that worked last week. The only thing that's changed in my environment since then is that the Linux box running jboss-3.0.4 is now getting its IP address via DHCP. The program hangs at the jndiContext.lookup() call at the end. The log files don't seem to indicate any problems. I got a few warnings about missing jar files that according to a search on the forum, appear not to be a problem. I tried browsing the IP address and port, but I got nothing from that. Is there any definite way to know that the JNDI service is actually up and running?
public static void main(String[] args) {
String queueName = null;
Context jndiContext = null;
QueueConnectionFactory queueConnectionFactory = null;
QueueConnection queueConnection = null;
QueueSession queueSession = null;
Queue queue = null;
QueueReceiver queueReceiver = null;
TextMessage message = null;
queueName = "queue/testQueue";
/*
* Create a JNDI API InitialContext object if none exists
* yet.
*/
System.out.println("About to get a context.");
try {
jndiContext = new InitialContext();
} catch (NamingException e) {
System.out.println("Could not create JNDI API " +
"context: " + e.toString());
System.exit(1);
}
System.out.println("About to get a queue connection factory.");
try {
queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("ConnectionFactory");