You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Antonio Ruiz <ar...@gmail.com> on 2012/08/04 17:22:03 UTC

Unable to locate properties file in .war file

Dear all,

I'm using Axis2 to generate a Web service and I would like to use some
configuration files (for properties and images) included in the .war
file to configure it.

For this purpose, I'm using the following method:
this.getClass().getResourceAsStream("config.file")

I have put the config.file in several directories of my .war file.
However, in all the cases the method does not found the file.

Where should I put the config.file? Is the way I'm using to recover it correct?

Could you be so kind of helping me, please?

Best regards.

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


AW: Unable to locate properties file in .war file

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
I am putting my log4j.properties into
C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.26\webapps\SpezplaFS\WEB-INF\classes
this delivered by a SpezplaFS.war file of course, and it works with Axis2-1.6.1

Now where to put it in the war ?
With NetBeans I have it located under the "project node" / WebPages / WEB-INF / classes

And the rest is done by mavens war plugin for me
 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <warName>SpezplaFS</warName>
                    <warSourceDirectory>${basedir}/src/webapp</warSourceDirectory>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                    </archive>
                    <webResources>
                        <resource>
                            <directory>${project.build.directory}/modules/</directory>
                            <targetPath>WEB-INF/lib</targetPath>
                            <includes>
                                <include>addressing*.mar</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>

Josef

-----Ursprüngliche Nachricht-----
Von: Antonio Ruiz [mailto:aruizma@gmail.com] 
Gesendet: Samstag, 4. August 2012 17:22
An: java-user@axis.apache.org
Betreff: Unable to locate properties file in .war file

Dear all,

I'm using Axis2 to generate a Web service and I would like to use some
configuration files (for properties and images) included in the .war
file to configure it.

For this purpose, I'm using the following method:
this.getClass().getResourceAsStream("config.file")

I have put the config.file in several directories of my .war file.
However, in all the cases the method does not found the file.

Where should I put the config.file? Is the way I'm using to recover it correct?

Could you be so kind of helping me, please?

Best regards.

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


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