I am creating a RESTful web service using Netbeans 8.1 and Glassfish 4.1. I have used Maven web application to create a server application.
I am using a client that sends an XML request and gets back a XML response from the server. I have a FoodItemData.xml
file in my server project that I read from everytime a request comes in from the client.
I have stored the FoodItemData.xml
file in the
project_name -> src -> resources -> FoodItemData.xml
of my project.
Whenever I run my server application, Glassfish throws the following error:
Severe: java.io.FileNotFoundException: E:\GlassFish\glassfish-4.1.1\glassfish\domains\domain1\config\src\resources\FoodItemData.xml (The system cannot find the path specified)
If I create the file at path src/resources/FoodItemData.xml
in the 'config' directory of Glassfish, the error goes away.
My Glassfish 'config' directory by default does not have the src/resources/FoodItemData.xml
file.
My question is, is there any way I can make the server application automatically create it? Because I am going to run this server application on a different system, so I cannot always manually create the folder in the Glassfish directory.
Quick help would be appreciated. Thank you!