I am developing a Spring application using the Spring tool suite. My basic aim to read an existing xml file and do some stuff with it.
The problem I am facing is that I am not able to use relative file path while running my code on server (tomcat 8.0.18). But if I test the same code as a Java application it runs fine.  

My folder structure - 

```
RootFolder
-- src/main/java
-- -- package_name
-- -- -- FileAccessingClass.java
-- data
-- -- xmlFile.xml

```

I get the following the error-

```
/Users/amit/Desktop/sts-bundle/sts-3.6.3.SR1/STS.app/Contents/MacOS/data/xmlFile.xml (No such file or directory)
Feb 13, 2015 3:27:29 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [appServlet] in context with path [/metaract] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
    at com.crmantra.metaract.services.ServiceRequests.prepareData(ServiceRequests.java:49)
    at com.crmantra.metaract.services.ServiceRequests.sendRequest(ServiceRequests.java:34)
    at com.crmantra.metaract.controllers.LoginController.login(LoginController.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

```

I don't understand why it is trying to look for the file on the Desktop where my STS is installed.  

Please let me know if the question is not clear enough. Any help would be appreciated.