Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

EJB in WAR Accessible from Components in Other Modules?

 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Enthuware Software Support
Posts: 4502
44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic