[jboss-user] [EJB 3.0] - Can you Inject Local EJB from separate ear file?

jfrankman do-not-reply at jboss.com
Thu Jul 10 22:56:24 EDT 2008


I have two session beans each deployed in a different ear's on the same JBoss server. Can i successfully inject Session bean A into Session bean B if each one is deployed in a different ear? I keep getting this error and everything looks ok so I assume that they must both be within the same ear for @EJB injection to work. Can anyone tell me this is correct?

here is the error I get upon deployment:

"  Reason: java.lang.RuntimeException: could not resolve global JNDI name for @EJB for container KeyBankCheckImagesMessageHandler: reference class: com.idfbins.nexusevents.services.NexusEventsService ejbLink:  not used by any EJBs"

Here is my how I inject it:

public class KeyBankCheckImagesMessageHandler implements MessageListener{
  | 
  | 	@PersistenceContext(unitName = "KeyBankChecksDB")
  | 	private EntityManager em;	
  | 	
  | 	@In(create=true) KeyBankServices keybankServices;
  | 	
  | 	@EJB(name="NexusEvents/NexusEventsServiceImpl/local")
  | 	NexusEventsService nexusEventsService;

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

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



More information about the jboss-user mailing list