2

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.

Community
  • 1
  • 1
Abhi
  • 41
  • 1
  • 2
  • found this article. Exactly what I needed. [Communication between EJB modules in the same Application Server](http://piotrnowicki.com/2012/11/communication-between-ejb-modules-in-the-same-application-server) – Abhi Jan 15 '14 at 10:04

0 Answers0