I have developed a web service in axis2, tomcat and eclipse. There are two properties files I am using: One is to keep the database credentials and another for defining log4j properties. I kept the files at com.resources folder.
I am accessing the properties files with the path "resources/global_system_db.properties" and "resources/log4j.properties" from inside the code.
When I run the application as Java applicatiin - It works fine and reads both files properly.
When I run the application as web service using the "run on server" option of eclipse - It still works fine and read the properties files.
BUT When I build the .aar and copy it to "Tomcat 5.5/webapps/axis2/WEB-INF/services" and then try to invoke the web service it does not recognizes the path!! And gives the error as can not read from the given path!!
I tried a few things:
1) Set the classpath till <Tomcat 5.5-HOME>webapps/axis2/WEB-INF/
2) Tried printing System.getProperties("user.dir") and then keeping both the properties files at the location given by print.
Does any one has any idea what is going wrong and how can I correct it?
While creating the .aar for your application, does you have mention the correct location for properties files?
scjp 1.5, OCPJWSD 5
Joined: Apr 22, 2009
Rizwan Patel wrote:While creating the .aar for your application, does you have mention the correct location for properties files?
Well, the creation of .aar is nothing but the zip file creation for folders META-INF and com and then to change the extension to .aar. So basically I am trying to say that there is no provision of defining the path as such, I guess when we deploy the .aar in axis2 services the axis2 tries to read the path as given in code say resources/log4j.properties and may be as application context changes the user.dir path must be changing. I have also tried putting the two properties files directly at <TOMCAT-HOME> level but it did not work
subject: Axis2 Web service - path recognition difference while running using eclipse and deploying as .aar