[jboss-user] [EJB 3.0] - Re: can not lookup session bean under Jboss 4.2.2GA and ejb3

Wolfgang Knauf do-not-reply at jboss.com
Wed Jan 16 07:57:58 EST 2008


Hi !

first of all: I would suggest you annotate the remote interface "test" with "@Remote()", not the bean.

next: let the bean class implement the interface.

third: I think you cannot cast the lookup result directly to the bean interface.
I always used this:
InitialContext initialContext = new InitialContext(properties);
  | Object objRemote = initialContext.lookup("testBean/remote");
  | Test testRemote = (Test) PortableRemoteObject.narrow(objRemote, Test.class);

Hope this helps

Wolfgang

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

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



More information about the jboss-user mailing list