I have 2 EJB projects.
- Ejb1
- Ejb2
Ejb1 has Stateless Local Session bean.
package p1;
@Stateless
public class CallerNew implements CallerLocal {
Ejb2 has Stateless Remote Session bean.
package p2;
@Stateless
public class MobilePhone implements MobilePhoneRemote {
@EJB(mappedName="CallerNew/local-p1.CallerLocal")
CallerLocal caller;
I deployed both the projects individually in the same server (JBoss v5.0).
The server registers CallerLocal also in Global JNDI namespace.
The question is even though I have made the CallerLocal as Local session bean, I can still get its reference through the JNDI from a separate EJB project which I thought is only possible if both the EJB projects are packaged into an EAR.
Is this behavior correct? please explain.