Search code examples
javaweb-servicestomcatwso2apache-axis

File Path issue in Java Axis2 WebService


I'm developing a web service using axis2 & tomcat . There I use a data.xml file to store some information. When I give the Absolute Path for the data.xml file, everything works fine. But I am looking for a way to give the file path in relative to the source file. To achive that I have tried several methods.

(the deployed aar file is located under C:/tomcat/webapps/axis2/WEB-INF/service.aar )

This is my folder structure.

+Project
|-src
|-data
  |-data.xml
  1. I have added the data folder to the build path.
  2. I have tried to include the file as ./data/data.xml

But it failed. Can anyone suggest me a best/recommended way to do this?

-Regards


Solution

  • After a long research, I found that it is impossible to do it. It should be a absolute path for the xml file.