Hi shah
Can u tell me the how can i run the this client program.when i run this client program i facing this exception ...
javax.naming.ServiceUnavailableException: NULL returned when resolving initial r
eference=NameService
at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtx
Factory.java:452)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCt
xFactory.java:337)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtx
Factory.java:200)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(W
snInitialContextFactory.java:80)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
65)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at ConverterClient.main(ConverterClient.java:29)
------------------------------
ConverterClient.java
import convert.*;
import javax.servlet.http.*;
import java.io.*;
import java.rmi.*;
import javax.rmi.*;
import java.util.*;
import javax.naming.*;
import javax.ejb.*;
import java.math.BigDecimal;
public class ConverterClient {
public static void main(
String[] args) {
try {
System.out.println("Hi this is the Small");
//Hashtable h=new Hashtable();
Properties h =new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
h.put(Context.PROVIDER_URL,"iiop://localhost:900");
System.out.println("the h value is :"+h);
Context initial = new InitialContext(h);
System.out.println("********"+initial);
Object objref = initial.lookup("ConverterBean");
System.out.println("7777777"+objref);
ConverterHome home =(ConverterHome)PortableRemoteObject.narrow(objref,ConverterHome.class);
Converter currencyConverter = home.create();
BigDecimal param = new BigDecimal ("100.00");
BigDecimal amount =currencyConverter.dollarToYen(param);
System.out.println(amount);
amount = currencyConverter.yenToEuro(param);
System.out.println(amount);
System.exit(0);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}
pls help me shah if possible ...
I need some steps also for deployment for this WSAD5.0