cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Omar Adobati" <omar.adob...@gmail.com>
Subject Loading a configuration file from a jar
Date Thu, 19 Oct 2006 13:43:55 GMT
Good Morning,

  I have developed a jar file and I need to load some configuration
parameters from a .properties file placed outside of the jar itself.

The jar file is under $cocoon/WEB-INF/lib directory and the
.properties file too.
Now, the problem is that my own class (that extends the
java.util.Properties class) can't locate the properties file.
Here is the code I'm actually using:

public ConfigUtility(){
	super();
	File configFile = new File("/nptl.im.properties");	
	try{
	  configURL = configFile.toURL();
	}catch (Exception ex){
           ex.printStackTrace();
	}
		
        //do some other useful stuff
  }

I'm running cocoon 2.1.18 with tomcat 5.5.x and JDK 1.5

Thanks for your help :)

-- 
Omar Adobati

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message