Help needed resolving this issue as i am struck moving forward with this. I am using RI Deploymenttool.
When i try to run AdviceCleint, i get the belwo error.
C:\projects\advice>
java -cp "%CLASSPATH%;c:\projects\advice\AdviceAppClient.jar;." AdviceClient
Hello World!
IN GO
javax.naming.CommunicationException: Can't find SerialContextProvider
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:63)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:38)
at AdviceClient.main(AdviceClient.java:14)
-------
CLASSPATH:
C:\projects\advice>echo %CLASSPATH%
C:\j2sdkee1.3.1\bin;C:\j2sdkee1.3.1\lib;C:\j2sdkee1.3.1\lib\j2ee.jar;C:\j2sdkee1.3.1\lib;C:\
j2sdkee1.3.1\lib\j2ee-ri-svc.jar;.
-------AdviceClient.java ------
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import headfirst.*;
import javax.ejb.*;
import java.util.Hashtable;
public class AdviceClient
{
public static void main(
String[] args)
{
System.out.println("Hello World!");
new AdviceClient().go();
}
public void go(){
try
{
System.out.println("IN GO");
Context ic = new InitialContext();
Hashtable map = new Hashtable();
/*
map.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
map.put("java.naming.provider.url", "iiop://localhost:1050");
Context ic = new InitialContext(map);
*/
Object o = ic.lookup("Advisor");
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o, AdviceHome.class);
System.out.println("GOT HOME");
Advice a = home.create();
System.out.println(a.getMessage());
System.out.println("GOT MESSAGE");
}catch (Exception ex){
ex.printStackTrace();
}
}
}
Thanks in advance.
Also, I am using getMessage method to avoid the CORBA BAD COMMAND ERROR.
[ October 21, 2006: Message edited by: Sai Charan ]