简体   繁体   English

IOException通过Javamail通过Webservice发送pdf

[英]IOException send pdf by Javamail via webservice

Guys I got a problem to send a PDF on java mail on webservice. 伙计们,我在通过网络服务在Java邮件上发送PDF时遇到问题。 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) . 当我尝试运行类进行测试时,电子邮件发送成功,但是以某种方式尝试通过webservice发送电子邮件时,相同的方法找不到File并显示IOException (The path is not found) So how shall I describe the file path on the method to run it on web service? 那么,如何描述在Web服务上运行文件的方法的文件路径?

Project Build and code. 项目构建和编码。

在此处输入图片说明

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 = ... 字符串tHomeArquiovo = ...

    System.out.println(new File(tHomeArquiovo).getAbsoluteFile()); System.out.println(新文件(tHomeArquiovo).getAbsoluteFile());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM