Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

refering a property file in the manifest

 
Venkat Babu
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a manifest file and have listed required jar files in the Class-Path of the Manifest file, this works fine. I am trying to refer a property file using Class-Path of the Manifest but it doesn't work. Please let me know if this is the correct way or is there any other approach.

Thanks in advance.
Babu
 
Paul Clapham
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classpath is a list of jar files and directories. So if what you tried was putting the name of the properties file in the classpath, then no, that wouldn't work. Putting the name of the directory which contains the properties file in the classpath would have a better chance of working.
 
Venkat Babu
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for you reply. I tried mentioning the directory name where the property file is located in the manifest file but it didn't work. Any other idea(s)?

Thanks again.
 
Paul Clapham
Sheriff
Posts: 21133
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it were me, I would have a look at the code which tries to access the properties file next.
 
Venkat Babu
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manifest-Version: 1.0
Main-Class: statusupdate.StatusUpdateEmail
Class-Path: lib/ojdbc14.jar lib/activation.jar lib/mail.jar lib/log4j.jar .

First I gave the full directory path where the property file is located later I changed mentioning a "." at the end of the class path in the manifest. (both options didn't work)

Directory structure:

log4j.properties
lib/ojdbc14.jar
lib/activation.jar
lib/mail.jar
lib/log4j.jar
myjar.jar


In the code do I need to use the class loader to load log4j.properties.

getClass().getClassLoader().getResourceAsStream("/log4j.properties");

I tried that option too, but no luck.
[ August 28, 2008: Message edited by: Venkat Babu ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic