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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

ejb-jar / utility jar dependencies

Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this post might belong in the ejb-forum, but since i'm currently studying for the scbcd exam, i didn't want to sound like a dunce posting it there

the headfirst ejb book briefly mentions using abstract 'super-interface' implementation classes to avoid having to code empty ejbActivate, ejbPassivate, etc. in a Bean class. For example, one can create an abstract class that implements the SessionBean or EntityBean interface, along with container callback methods. By extending this abstract class, one could avoid having to code empty implementations of these 7 methods in a Bean class.

For my own research, I'm trying to implement this pattern. I want to place a reusable abstract class in a jar that can be reused across several other ejb-jar's. However, I'm unaware how jar dependencies must be declared for ejb's, if at all. For example in a WAR file, one can place dependent jar files (like ejb client jars, utility jars, etc.) in the WEB-INF/lib folder. As long as the required jars are there, one need not declare jar dependencies in web.xml.

Will this also work for an ejb-jar file? Could I simply put my abstract-ejb.jar file in the META-INF/lib folder? Or must jar dependencies be declared in the application.xml so that they function properly in the EAR file?
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can simply put your util.jar at the root of ejb JAR and refer it in the manifest file.

In the add the following line:
Class-Path: util.jar

This has worked for me in Weblogic.
All of the following truths are shameless lies. But what about this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic