bugs.java.com
Bug ID: JDK-4267294 InputStream must be created in getInputStream...
InputStream pdf = new FileInputStream("myfile.pdf") ; DataSource mailds = new PdfDataSource(pdf) public String getName() {. return "PDFDataSource" ; } } Here's the stacktrace from the exception: java.io.IOException: read error.