axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hall <sh...@starmountsystems.com>
Subject Re: Axis2 with Properties
Date Thu, 24 Jul 2008 12:24:17 GMT
Joern,

I'm not sure how you are deploying your web service. However, if it is 
in a webapp (like the axis2 webapp), then place the properties file in 
the WEB-INF/classes directory and use the following code.


        // Read properties file.
        Properties properties = new Properties();
        try
        {
            properties.load(this.getResourceAsStream("axis.properties"));
        }
        catch (IOException e)
        {
            logger.error("Cannot locate axis.properties file", e);
        }

Steve Hall


joern.albinger@gmx.de wrote:
> Hello,
>  
> I have a problem with my properties class. After archiving my service 
> my database controller can't locate or read the properties data.
> In the data are the settings for the database connection like treiber 
> , username url .
> Where do I have to place the properties for the right reading and is 
> it possible to use a normal properties like this:
>  
> **
>
> *private* *boolean* loadProperties() {
>
> *boolean* data = *false*;
>
> *try* {
>
> /properties/.load(*new* FileInputStream(config));
>
> data = *true*;
>
> } *catch* (*final* FileNotFoundException e) {
>
> System./out/.println("Config File konnte nicht gefunden weren oder 
> existiert nicht.");
>
> data = *false*;
>
> e.printStackTrace();
>
> } *catch* (*final* IOException e) {
>
> System./out/.println("Es ist ein Fehler beim Lesen der Config Datei 
> aufgetreten.");
>
> data = *false*;
>
> e.printStackTrace();
>
> }
>
> *return* data;
>
> }// end of load Properties
>
>  
>  
> I hope , that someone can help with this problem.
>  
>  
> Best regards
> Jörn 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message