• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sharing information across WAR applications

 
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Upon Kyle's advice, I've read the Infocenter part about module visibility (6.4) and I would like to have you opinion about this.
The J2EE pateform does not allow to communicate between WARs due to the classloaders structure (AC).
But I can "bypass" this if put the classes to be shared in the application extension zone (AEX).
The each AC can "see" classes loaded by AEX, 'cause AEX is the parent.
My question is :
Is this really something we can recomend ?
1) As far as I am concerned, I thinks it is in opposition to the J2EE specification. The application packaging rules are not followed anymore
2) I'm not sure to fully understand the AEX zone, but I guess classes here are started once at the App Server start.
It means if I want to change a release, I got to stop all my Enterprise Servers... Yerk !!
Did I miss something.

Could you share your experience. Did you ever use this WAS feature ?
3) One more question.
The relationship between EAR and WAR is one-to-many.
If I can include many WAR in my EAR but I can't make these WAR communicate with each other, what is it used for ??
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm... Well, that's not really the section I was referring to...
I really wanted you to look at 6.6.3.0, where the section says:
"The classloader isolation mode to use for the application server. By changing the default visibility level, it is possible to have visibility of classes in other modules, or even other applications.
Specify "SERVER" to allow all application classloaders on the system to have visibility of all other application classloaders in the system. Search order is the same order as when the modules were initialized into the system.
Specify "APPLICATION" to allow all classloaders in a J2EE application to have visibility of other classloaders in the same application. Search order is the order the modules are defined in the application.xml for the EAR.
Specify "MODULE" to use one classloader per module. Each module (EAR, JAR, or WAR) has its own unique classloader. Visibility to other modules in the application is only achieved when MANIFEST Class-Path entries are added to a module.
Specify "COMPATIBILITY" for compatibility with applications from WebSphere Application Server 3.5.x and 3.0.2.x. In this mode, all EJB module classloaders have visibility of all other EJB module classloaders and all Web Application modules have visibility of the EJB classloaders. Search order for the EJB classloaders is determined by the order in which the EJB modules were initialized.
Portable J2EE applications should be written with Module-level visibility. The other modes are provided to accomodate applications that have different visibility requirements that cannot be modified."
If you set the visibility to "Application" all the WARS in the EAR see each other...
Kyle
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Kyle.
I had missed this one.
Now I understand better what I can and cannot do with WebSphere.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if I am in the module visibility, how do I reference external EJB (I mean EJB that are not in the same ear of their client module).
Is it something like that in the manifest :
myear.ear/myejb.jar
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should NEVER reference an EJB that's not in your EAR regardless of the visibility. There is an upcoming article on that that I'll have published in DeveloperWorks that should explain my viewpoint on this...
Kyle
 
reply
    Bookmark Topic Watch Topic
  • New Topic