• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Clarification about ejb-jar

 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Ant manual says (about ejb-jar):

The task uses the jakarta-BCEL framework to extract all dependent classes. This means that, in addition to the classes that are mentioned in the deployment descriptor, any classes that these depend on are also automatically included in the jar file.


Does this mean that the ejb-jar task figures out which classes I have used "within" the implementation in addition to the classes visible in the interfaces/method signatures/etc?
 
Author
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. Then another question.
Consider a scenario where the bean implementation uses some 3rd party library. Assuming the 3rd party library will be in the classpath, does Ant try to copy the 7 class files my EJB is using/importing from the 3rdParty.jar into MyEJB.jar?
 
Kirk Pepperdine
Author
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yikes, you've just turned this into an ugly classloader question with EJB mixed in to boot!!!

I can give you some mumbo jumbo explination of classloaders, security, class identity etc but, you're probably more interested in hearing about vendor specific deployment descriptors needed to get this to work. For that, I suggest moving this question to the WL forum.
If this is a sticking point, might I suggest that you unjar the third party jar and then rejar into your deployment jar. I would suggest that this "stratigic hack" not make out of the development environment as this does by-pass some protections provided by the EJB/J2SE deployment/classloader models.
 
Kirk Pepperdine
Author
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forgot to add, one of the dangers is that "local" EJB calls work as a pass by reference. Non-local EJB calss work as a pass by value. I believe that local calls made between beans deployed in the same jar will be "short-circuited" or pass by reference. Changing the deployment model in the future may have serious effects on performance as if the calls can no longer be short-circuited, then the semantics will be pass by value.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kirk Pepperdine:
If this is a sticking point, might I suggest that you unjar the third party jar and then rejar into your deployment jar.


Umm... I DON'T want to have the 3rd party classes inside my .jar for the obvious reasons. What I wanted to know is whether Ant will do this or not.
I'm not sure about how this relates to vendor-specific deployment descriptors?
 
Kirk Pepperdine
Author
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't believe that ANT will extract the class files from the JAR. If it did and you had the jar on your system classpath, then that could cause some real difficulties.
As for the deployment descriptor connection, this gets a little bit off track but, I do believe that you are support to declare any jars that you might be referencing. But, since the jar is in your system classpath, you'll automatically have access to it via the system classloader.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. I think I'll play around for a while and see what I come up with.
Thank you for the advice and support.
 
and POOF! You're gone! But look, this tiny ad is still here:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic