-
1. Re: InitialContext.lookup returns null
jaikiran Oct 31, 2006 7:34 AM (in response to mashiur_valo)What are you looking up?
-
2. Re: InitialContext.lookup returns null
peterj Oct 31, 2006 10:38 AM (in response to mashiur_valo)Also, do you have a firewall on the Linux machine? If so make sure you open the ports 1098, 1099, 4443 and 4444 (or their equivalents if you changed the port settings). The last two you might not need unless you are accessing mbeans.
-
3. Re: InitialContext.lookup returns null
mashiur_valo Nov 1, 2006 1:00 AM (in response to mashiur_valo)In my jndi.properties file I have written as follows
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://192.168.1.104:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
My client program is as follows
1. Properties prop=new Properties(new FileInputStream("jndi.properties"));
2. InitialContext context=new InitialContext(prop);
3. Object obj=context.lookup("MyEjb");
Line 1 and 2 has no problem, but in line 3 when I look up my ejb in server it returns null. I am not using any firewall and my necessary ports are open.
When I run my java client program in linux machine where my JBoss server is located then no problem occurs. -
4. Re: InitialContext.lookup returns null
peterj Nov 1, 2006 10:30 AM (in response to mashiur_valo)Try this. Enter the following at a command prompt on Windows:
telnet 192.168.1.104 1099
The last line of the response shpould have an IP address in it. On my PC it looks like:
UnicastRef2192.59.193.104?Jsëk½?ñ#·gÇx
If the IP address does not match that of your Linux box, add the following line to your /etc/hosts file:
192.168.1.104 <simple-pc-name> <pc-name-with-full-domain>
Example:
192.168.1.104 linuxbox1 linuxbox1.cox.net -
5. Re: InitialContext.lookup returns null
mashiur_valo Nov 3, 2006 11:58 PM (in response to mashiur_valo)My problem has been solved.
Thanks to everyone for giving me the solution. -
6. Re: InitialContext.lookup returns null
gsoing Aug 23, 2007 11:30 AM (in response to mashiur_valo)Hello,
I have the same problem. How did you solve it?
Thanks
Delphine -
7. Re: InitialContext.lookup returns null
samavedulark Nov 9, 2012 7:40 AM (in response to gsoing)Hi Peter,
I have the same issue, and in log file i am getting some thing like this.
Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: R2SP11:11099 [Root exception is javax.naming.CommunicationException: Failed to connect to server R2SP11/192.168.1.46:11099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server R2SP11/192.168.1.46:11099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
I am getting something like this R2SP11/192.168.1.46
Thanks