[jboss-user] [EJB 3.0] - Re: java.lan.ClassCastException when casting to remote bean

Wolfgang Knauf do-not-reply at jboss.com
Wed Nov 19 15:22:25 EST 2008


I learned to use this code snippet to convert the JNDI lookup result to a remote interface:
Object objRemote = ctx.lookup("simpleserver/" + SimpleStatefulBean.class.getSimpleName() + "/remote");
  | 
  | SimpleStatefulBeanRemote o = (SimpleStatefulBeanRemote ) PortableRemoteObject.narrow(objRemote, SimpleStatefulBeanRemote .class);

Andrew, is a direct cast supported in JBoss 5?

Hope this helps

Wolfgang

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4190624#4190624

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4190624



More information about the jboss-user mailing list