Hi,
This is right way.

props.load(getClass().getClassLoader().getResourceAsStream(filename));

      Vladi


-----Original Message-----
From: Java Programmer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 29, 2006 2:27 PM
To: axis-user@ws.apache.org
Subject: Reading properties files from AXIS

Hello,
I never do it before but I need to read properties file from an
application deployed as a service of AXIS. My first unsuccessful
attempt was:

Properties props = new Properties();
URL url = ClassLoader.getSystemResource("lucene.properties");
props.load(url.openStream());

System.out.println("Using index: " + props.getProperty("index.location"));
this.indexLocation = props.getProperty("index.location");

File lucene.properties I put in
${tomcatDir}/webapps/axis/WEB-INF/classes/lucene.properties, so I
thought I could read it as resource in non-web application using
classpath load, but it won't work - I think that in web servers must
be another way to read properties, maybe some dedicated for AXIS.
Maybe there is another option to provide variables to AXIS without
hardcoding them into Java classes you could share?

Best regards,
Adr

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to