[jboss-user] [EJB 3.0] - Re: @EJB injection always injects remote object, why not loc

wolfc do-not-reply at jboss.com
Thu Aug 2 04:35:25 EDT 2007


Post your bean code. I think the container allows an illegal construct.

You can't use the same interface both as local and remote.
So either:
@Stateless
  | @Remote(MyStatelessRemote.class)
  | @Local(MyStatelessLocal.class)
  | public class MyStatelessBean
or
@Stateless
  | public class MyStatelessBean implements MyStatlessLocal, MyStatelessRemote
  | 
  | @Remote
  | public interface MyStatelessRemote extends MyStateless
  | 
  | @Local
  | public interface MyStatelessLocal extends MyStateless
The proxy chosen for injection will depend on the interface used.

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

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



More information about the jboss-user mailing list