Iam working with sample stateful session bean
can any body please reply me what could be the problem here in my client code below.
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://localhost:7001");
prop.put(Context.SECURITY_PRINCIPAL, "venu");
prop.put(Context.SECURITY_CREDENTIALS, "venuvenu");
Context ctx = new InitialContext(prop);
Object obj = ctx.lookup("banking");
banksfullHome home = (banksfullHome)PortableRemoteObject.narrow(obj,banksfullHome.class);
banksfullRemote br1 = (banksfullRemote)PortableRemoteObject.narrow(home.create(999),banksfullRemote.class);
banksfullRemote br2 = (banksfullRemote)PortableRemoteObject.narrow(home.create(888,"Shiva",3000.00),banksfullRemote.class);
System.out.println(br1.getBalance());
System.out.println(br2.getBalance());
.................
and my Home is
public interface banksfullHome extends EJBHome
{
public banksfullRemote create(int accNo) throws RemoteException,CreateException;
public banksfullRemote create(int accNo,
String accName,double bal)throws RemoteException,CreateException;
}
iam getting ClassCastException when running client as:
java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)