File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Properties file in EJB Ear Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Properties file in EJB Ear" Watch "Properties file in EJB Ear" New topic
Author

Properties file in EJB Ear

Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 209
Hello Friends,
I have a simple question to all. I am developing a MDB. I have some configuration things and application related properties in a file
config.properties.

Normally in web application war, to make servlet or any java class file to read this we can keep in web-inf classes

But for EJB, where to keep such properties file to be read by ejb in ear.

I Kept in a folder called resources/ in ear root itself
and gave the path in manifest.mf of ejb.jar as

Classpath: resources/

But i am not able to pick it up. May i know the right approach for the same


SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3652

Take a look at the method getResourceAsStream, it's useful for reading property files from within JARs.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Properties file in EJB Ear
 
Similar Threads
property files in ejb tier
EAR deployment problem Weblogic Migration... additional resources needed on classpath
Reading external properties file from EJB
resources in multi war or ear application
Is it wrong to place EJB jars in a WAR file?