Amith Jayanthilal
2005-02-11 04:25:57 UTC
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 !!!
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 !!!