I am deploying a WAR file in Tomcat for a webapp (my first time doing this) that I've developed. The problem comes when I deploy the app and the resources can't be found.
I am saving the files (for example a CSV file) in this foulder of the project:
"src/main/resources/diseases.csv"
And when I deploy the project in tomcat, tomcat give me this error:
"org.apache.spark.sql.AnalysisException: Path does not exist: file:/opt/tomcat/apache-tomcat-9.0.16/bin/src/main/resources/conenfermedad.csv;"
This is the line of the code where I am having the error:
String dataPred = thalg.randtrp("src/main/resources/conenfermedad.csv",
"src/main/resources/outWekaEnfermedad.arff");
EDIT: I have been trying differents solutions but I have the same problem because if I use InputStream how can I get the path to use a dataFrameReader (this only use path as String)?
InputStream is = getClass().getResourceAsStream(In);
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
//InputStream is = getClass().getResourceAsStream(In);
final DataFrameReader dataFrameReader = sparkSession.read().option("header", true);
final Dataset<Row> trainingData = dataFrameReader.csv(In).toDF("IDPatient", "ECG_EKG", "Temp",
"SPO2Min", "SPO2Max", "BPMmin", "BPMmax", "BPMavg", "SYS", "DIA", "EDAmin", "EDAmax", "EDAavg", "Disease");
// con "*.csv" para que lea todo el directorio
What should am I doing wrong?
Thanks in advance :)