Can anyone tell me why the following code generates an Exception? The code is in a stateless session bean named SB1 that is trying to obtain a local ref to another stateless session bean named SB2. SB2 is deployed and appears in my jndi tree as "SB2" and "SB2Local".
Code:
context = getInitialContext();
SB2LocalHome sb2Home = (SB2LocalHome) context.lookup("java:comp/env/ejb/SB2Local");
Exception:
javax.ejb.CreateException: Create Exception in SB1: Unable to resolve 'app/ejb/SB1.jar#SB1/comp/env/ejb/SB2Local' Resolved: 'app/ejb/SB1.jar#SB1/comp/env' Unresolved:'ejb'
-
ejb local references (1 messages)
- Posted by: Dave Segal
- Posted on: June 27 2003 14:55 EDT
Threaded Messages (1)
- ejb local references by Brian Tinnel on June 30 2003 08:35 EDT
-
ejb local references[ Go to top ]
- Posted by: Brian Tinnel
- Posted on: June 30 2003 08:35 EDT
- in response to Dave Segal
Can anyone tell me why the following code generates an Exception? The code is in a stateless session bean named SB1 that is trying to obtain a local ref to another stateless session bean named SB2. SB2 is deployed and appears in my jndi tree as "SB2" and "SB2Local".
>
> Code:
>
> context = getInitialContext();
> SB2LocalHome sb2Home = (SB2LocalHome) context.lookup("java:comp/env/ejb/SB2Local");
>
> Exception:
>
> javax.ejb.CreateException: Create Exception in SB1: Unable to resolve 'app/ejb/SB1.jar#SB1/comp/env/ejb/SB2Local' Resolved: 'app/ejb/SB1.jar#SB1/comp/env' Unresolved:'ejb'
Do you have an ejb-ref or ejb-local-ref referencing SB2 in the deployment descriptor for SB1.
If not, you probably shouldn't use java:comp/env since it just looks at the references you have declared. I would suggest adding an ejb-ref and/or ejb-local-ref (looking at your code, you probably want ejb-local-ref) and see if that clears things up. Or you can just use the "real" JNDI name in your lookup.