Help! LocalHome Interface ClassCastException
Hi All, I am new to EJBs..
I am trying to call my remote/local Entity Bean in a servlet.
InitialContext jndiContext = new InitialContext();
Object ref = jndiContext.lookup("POrderMasterRemote");
//Object ref = jndiContext.lookup("POrderMaster"); <-- LocalHome - Line:X
System.out.println(ref.toString());
POrder.POrderMasterRemoteHome home = (POrder.POrderMasterRemoteHome)PortableRemoteObject.narrow(ref,POrder.POrderMasterRemoteHome.class); // success
//POrder.POrderMasterHome home = (POrder.POrderMasterHome)ref; <-- CastException - Line:Y
I can call my Entity Beans's RemoteHome inteface and cast it correctly, but i can not cast LocalHome interface. I am sure that i got something after Line:X.
This is System.out:
POrder.POrderMasterBean_93z9b4_LocalHomeImpl@17675
But Line:Y has ClassCastException:
java.lang.ClassCastException: POrder.POrderMasterBean_93z9b4_LocalHomeImpl
...
Could you tell me whats wrong? Thank you ~

