-1

I have a java web application. This app reads 2 excel file and process them and display the result on the screen. I am using Eclipse and tomcat v9 to implement and run the application locally. I have put the excel files in the root of the application. I have a function in ProcessFileUtility.java class that takes the file name of two excel files and process them. I give the absolute path of those two excel files to that function and it works on my local. But when I export the web application as .war file and deploy it on the tomcat server, I don't see my data displayed and my immediate guess is that the file path provided is an absolute path and should be some thing else. I know this question has been asked already but after reading many of them I am still struggling what to do. Can some please help me with this problem. I have also put an screen shot of the structure of my application.

Here is the path to excel files :

 ArrayDataModel<Record> records = this.processDataSources("C:\\EEworkspace\\PVvalidation\\ppmsOrigin.xlsx", "C:\\EEworkspace\\PVvalidation\\product_database-reverse-column.xlsx");

enter image description here

user1836957
  • 427
  • 2
  • 9
  • 24
  • Start by reading [ask] and doing ALL that is stated there – Kukeltje Feb 08 '18 at 05:43
  • @Kukeltje, I spent couple of hours searching for my question and did not find answer to it. I posted the question here with the hope of some helps and you just came and gave me a negative mark and No hint. well ! Thank you very much. People like you bring me down all day long ... – user1836957 Feb 08 '18 at 07:22
  • You need to understand you are not the only one seeking help. There is a **very good** reason [ask] states what it states. For some issue s there could be a multitude of reasons and very, very often they all have been discussed already. I just don't have the time to start asking al kinds of questions, searching for possible causes, link them in the comments etc... That is something **you** should do. In additions. In [ask] there is a reference to [mcve] which you also fail to post if it might be a cause. How can we know if paths you use in some not visible code are a problem. – Kukeltje Feb 08 '18 at 08:16
  • Hover over the downvote triangle and see what it states. For me this is acutally true, so the downvote is an incentive to improve your question. It will be removed when it is aproved. Cheers – Kukeltje Feb 08 '18 at 08:17
  • if you were a co-op student who got stuck and had no help around, you would know how I fill. Some times the answer in other posts just does not make so much scene to me due to my little knowledge, any how that is how It is, experienced people some times forget where they start from ... cheers – user1836957 Feb 08 '18 at 08:29
  • Sorry, that is BS... If you found a possible answer that does not make sense ask for clarification. Not doing that and just posting a new question does not help. And using an absolute path to a worksspace in a deployed app is very, very weird... – Kukeltje Feb 08 '18 at 09:41

1 Answers1

0

The problem is actually the path you are using. Don't expect the server to have that path and file unless you create it.

Please refer to this answer and see how the file is inside the src folder. That way your application will be able to find the file inside it's folder.

Diego Lo
  • 139
  • 7