aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJB in WAR Accessible from Components in Other Modules? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "EJB in WAR Accessible from Components in Other Modules?" Watch "EJB in WAR Accessible from Components in Other Modules?" New topic
Author

EJB in WAR Accessible from Components in Other Modules?

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Section 20.4.3 in the EJB 3.1 specification says that the local client view and the no-interface view of an EJB deployed in a WAR file is only required to be visible to components within the WAR. To me, this implies that the remote view of an EJB deployed in a WAR file is supposed to be visible to components outside of the WAR; for instance another web component deployed in another WAR in the same EAR as the first WAR.
Despite intricate experiments in my underground laboratory with the previous scenario, two WAR files in an EAR with an EJB in one of the WAR files, I have not been able to access the remote view of the EJB in the first WAR from a servlet in the second JAR.
Is there anyone who has any thoughts on this?
Thanks in advance!


My free books and tutorials: http://www.slideshare.net/krizsan
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 512
Hi,
Did you get any excpetion while doing this?

BTW I wasn't aware of the fact that in 3.1 you could deploy the EJB in a WAR file. Thank you for the reference in the specification. I just read that.

However from your question it seems that what you are trying to do is the simpler thing i.e. accessing remote view which we have been doing right from the start when EJBs were born.

regds,
amit
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Yes, I get an exception saying something like name-not-found.
I am interested in knowing what components, in this case EJBs, are available outside of a WAR module - this even though the EJBs have remote views.
As of now, it seems like no EJBs deployed in a WAR are accessible from another WAR or from an EJB-JAR module.
All my experiments have been undertaken on the GlassFish v3.0.1 application server.
Best wishes!
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 512
Hi,
What JNDI name did you try to lookup?
Just to understand more about EJB 3.1, I was going through the EJB Spec. If you have not tried already you can try accessing the EJB using the global JNDI name as per "Section 4.4 - Global JNDI Access"

Regds.
Amit
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
amit punekar wrote:Hi,
What JNDI name did you try to lookup?
Just to understand more about EJB 3.1, I was going through the EJB Spec. If you have not tried already you can try accessing the EJB using the global JNDI name as per "Section 4.4 - Global JNDI Access"

Thanks for the suggestion, but I have already tried that.
GlassFish v3 lists the portable JNDI names of EJBs when they are deployed and I have tried those names.
Best wishes!
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3293
    
    7
Beans deployed from a different war/ejb-jar may be bound under different name spaces. So you might want to browse the JNDI tree from admin console and see the exact names the beans are bound to and then try to use those names.

...seems you already tried that!


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB in WAR Accessible from Components in Other Modules?