Some more code from the program:
Hashtable props = new Hashtable();
context = new InitialContext(props);
TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup("java:/RMIConnectionFactory");
topicConnection = topicFactory.createTopicConnection();
The lookup returns null so the next line causes a NullPointerException. I made a mistake in first post, it's the second line giving NullPointerException, not the first.
I am having the same problem running JBoss 3.2.0.
The strangest thing is, of the two identical server machines, the client works against one and fails against the other, consistently.
My code looks like this:
initialContext = new InitialContext();
System.err.println("got context " + initialContext);
Hashtable env = initialContext.getEnvironment();
String connectionFactory = (String)env.get(CONNECTION_FACTORY_JNDI_NAME);
String username = (String)env.get(Context.SECURITY_PRINCIPAL);
String password = (String)env.get(Context.SECURITY_CREDENTIALS);
Object factory = initialContext.lookup(connectionFactory);
The last line of code returned null, so factory is null.
The string value of connectionFactory is "UILConnectionFactory". I have tried "ConnectionFactory" as well and it failed the same way.
Can someone out there point out to me what the problem is?
I'm experiencing the same problem with jboss 3.0.4, but only in debian. If i run jboss in winXP, there's no problem.
I thought it was because the firewall. However i disabled the firewall, but the lookup is still returning null.
Help will be apreciated