File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Axis2 Web service - path recognition difference while running using eclipse and deploying as .aar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2 Web service - path recognition difference while running using eclipse and deploying as .aar" Watch "Axis2 Web service - path recognition difference while running using eclipse and deploying as .aar" New topic
Author

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

Pornima Khambete
Greenhorn

Joined: Apr 22, 2009
Posts: 3
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?
Rizwan Patel
Ranch Hand

Joined: Jan 03, 2008
Posts: 59
While creating the .aar for your application, does you have mention the correct location for properties files?


scjp 1.5, OCPJWSD 5
Pornima Khambete
Greenhorn

Joined: Apr 22, 2009
Posts: 3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis2 Web service - path recognition difference while running using eclipse and deploying as .aar
 
Similar Threads
Need help using annotations with Axis2
Apache Axis2: sent method arguments are not received
Problems with security policies for Axis2 in Tomcat
Axis2-1.4 help
Existing java class as a web service using axis2