• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis2 Web service - path recognition difference while running using eclipse and deploying as .aar

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

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?
 
Ranch Hand
Posts: 59
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While creating the .aar for your application, does you have mention the correct location for properties files?
 
Pornima Khambete
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic