for local beans you dont need to narrow using PortableRemoteObject - just cast normally.
hth dim On Sat, 1 Dec 2001, Jozsa Kristof wrote: > Hi, > > I have an entity bean and a stateless session bean playing on the fields. > >From the session bean, I'm trying to reach the entity bean through its local > interface, but it has both remote and local interfaces. I used similar code > as using its remote interface: > > InitialContext ic = new InitialContext(); > Object ref = ic.lookup ("myproject.Product"); > ProductLocalHome home = (ProductLocalHome) PortableRemoteObject.narrow (ref, >ProductLocalHome.class); > .. > > and at the PortableRemoteObject.narrow() call, RH throws a > ClassCastException. I looked up the EJB2 specs, and it shows an example code > doing that.. In spite of this, I think JBoss is right dropping this > exception, because the context's lookup returns a ProductHome type > interface, not a ProductLocalHome, and it seems logical not be able to cast > the remote interface to the local one. How can I lookup and initialize the > Local interface of my bean then? > > Thanks, > Christopher > _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user