[jboss-user] [JBossWS] - reading a local properties file

gryffin do-not-reply at jboss.com
Fri Feb 1 13:21:10 EST 2008


I'm writing a POJO/servlet based JAXWS web service on JBoss 4.0.5 w/ JBossWS 1.2.1. I'm trying to use a properties files located at /WEB-INF/properties.xml but I can't find the file. The only way I can seem to get the web service classes to find the properties file is to use an absolute URI from C: which is totally unworkable for production.

Using this code:
		if ( !(new File(propertiesPath).exists()) ) 
  | 		{
  | 			log.fatal("NOT FOUND: " + propertiesPath );
  | 		}
  | 

This fails, I've tried variations, but can't seem to find the path:
public static final String propertiesPath = "properties.xml";
This works,  
public static final String queriesPath = "C:/Documents and Settings/tx714c/workspace/NlsAssociationService341/WEB-INF/properties.xml";
and if I assume that '...\workspace' is my local dir, I can use a relative path. But I can't get a path local to the WAR file to work. 

Here's the listing of the war file:

  | C:\Documents and Settings\tx714c\My Documents\workspace\ShimWS3.4.1>jar -tf gen\NlsAssociationServic
  | e341.war
  | META-INF/
  | META-INF/MANIFEST.MF
  | WEB-INF/
  | WEB-INF/web.xml
  | WEB-INF/classes/
  | WEB-INF/classes/com/
  | ...
  | WEB-INF/classes/org/soapinterop/xsd/ValidationException.class
  | WEB-INF/lib/
  | ...
  | WEB-INF/lib/wsdl4j-1.5.1.jar
  | WEB-INF/properties.xml
  | WEB-INF/queries.xml
  | 

How do I access and load a local properties file from within the war? Thanks!



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125631#4125631

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125631



More information about the jboss-user mailing list