Wrox Home  
Search P2P Archive for: Go

  Return to Index  

j2ee thread: Class Cast exception


Message #1 by "Savita" <savita.rani@b...> on Sat, 22 Feb 2003 06:43:55
Hi,
I am getting class cast exception while in the following code::

initContext = new javax.naming.InitialContext();
String JNDIName = "java:comp/env/ejb/billing";
System.out.println("- Looking up: " + JNDIName);

Object objref = initContext.lookup(JNDIName);
Object obj = PortableRemoteObject.narrow(objref,BillingHome.class);

System.out.println("- typecast possible::"+(obj.getClass()).getName());
billingHome = (BillingHome)obj;
billingObject =billingHome.create();

The strange thing is this that I am not getting ClassCastException while 
using PortableRemoteObject's narrow() method.Its working fine.But when I 
type cast this obj to billingHome which is the Home Interface for my EJB.

can ne body help me?????

  Return to Index