-
1. Re: Context.lookup returns null
miksu Jun 11, 2003 7:27 AM (in response to miksu)Some more code from the program:
Hashtable props = new Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, myResources.getString("CHATHOST"));
props.put("java.naming.rmi.security.manager", "yes");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
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. -
2. Re: Context.lookup returns null
xibin Jul 24, 2003 4:37 PM (in response to miksu)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? -
3. Re: Context.lookup returns null
blakbox Sep 5, 2003 6:15 AM (in response to miksu)Hi,
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