Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

ejb-jar / utility jar dependencies

Posts: 18
  • Mark post as helpful
  • send pies
  • 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
  • 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.
"To do good, you actually have to do something." -- Yvon Chouinard
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic