Search code examples
javaeclipseweb-servicesioexception

IOException send pdf by Javamail via webservice


Guys I got a problem to send a PDF on java mail on webservice. When I try to run my class for test the email is send sucessful, but somehow when I try to send via webservice the same method can't find the File and shows IOException (The path is not found). So how shall I describe the file path on the method to run it on web service?

Project Build and code.

enter image description here


Solution

  • It look like you have use wrong path.

    1. You should try use absolute path instead of relations path,

    2. Use following code to debug:

      String tHomeArquiovo = ...

      System.out.println(new File(tHomeArquiovo).getAbsoluteFile());