Discussion:
Root exception is java.net.UnknownHostException:
(too old to reply)
Amith Jayanthilal
2005-02-11 04:25:57 UTC
Permalink
Hi,
I am trying to run a program SalaryCleint.java. Following are some of the lines of the code:

InitialContext ctx = new InitialContext();

Object objRef = ctx.lookup("Salary");

SalaryHome home = (SalaryHome) javax.rmi.PortableRemoteObject.narrow(objRef,SalaryHome.class);

Salary bean = home.create();

System.out.println("Monthly net salary: "+bean.calculateSalary(28000,2,500))

Following are the contents of my jndi.properties

java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=http://server:7001

When I try to run the program, I get the following error

Naming Exception caught:
javax.naming.ServiceUnavailableException [Root exception is java.net.UnknownHostException: server: server]
Press any key to continue...

I have weblogic.jar in my classpath.

What could be wrong ???
Please help.
Thanks !!!
Anders Mathisen
2005-02-11 09:11:43 UTC
Permalink
hi,

your TCP/IP stack known nothing about what the hostname server should be. Either edit you host file or fully qualify the server hostname.

PS. try to execute the following command "ping server"

- Anders M.

Loading...