0

My application generate PDF and save it in the WAR file. Everything works fine in the localhost but after deploying the WAR under the remote Wildfly server the app can't access the WAR file.

ut.setDestinationFileName( "../../wildfly-9.0.1.Final/standalone/deployments/MyApp.war/Rapport/SampleResult.pdf");
dur
  • 15,689
  • 25
  • 79
  • 125
  • It could be permissions issues on your remote server Is this the line that the error is showing? can you add a little more context to this code? – Sam Orozco Nov 08 '16 at 15:54
  • I suggest the following answer http://stackoverflow.com/a/18664715/1885672 and change your code if you are using absolute path. – Andrea De Gaetano Nov 08 '16 at 15:57
  • You can use `getServletContext().getRealPath("/WEB-INF/...")` or such, but consider whether you cannot stream it out immediately to a `response.getOutputStream()` (maybe in two steps: returning the new page with PDF generating URL). `../../` and such is horrible. – Joop Eggen Nov 08 '16 at 22:42

1 Answers1

0

thank you for answering, i found a solution, i don't know if it's the best one but it work: MyApp.war is a compressed file and ut.setDestinationFileName() can't access to a compressed file so i create a new folder under "wildfly-9.0.1.Final/standalone/deployments" and i name it MyApp.war and there i decompress the real war file and finally i restart the server.