Could not load com.sun.media.imageioimpl.plugins.tiff.TIFFStreamMetadata
Bonjour,
Je viens vous voir en désespoir de cause, je ne comprend pas mon problème et il est critique.
Dans un environnement de santé (donc très tendu en ce moment), je dois maintenir un servlet Java que je n'ai pas développé.
Le programme permet d'intégrer des PDF.
Une des fonctionnalités est d'appliquer une signature numérique. Il s'agit d'un fonctionnement a priori assez standard qui fonctionnait jusqu'à présent sans problème.
Malheureusement maintenant, il sort en erreur et créé des documents illisibles (mais l'utilisateur ne s'en rend pas compte).
En regardant les traces, je vois qu'il ne parvient pas à charger un élément pourtant standard : com.sun.media.imageioimpl.plugins.tiff.TIFFStreamMetadata
Voici le log :
Citation:
INFOS: Illegal access: this web application instance has been stopped already. Could not load com.sun.media.imageioimpl.plugins.tiff.TIFFStreamMetadata. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi.createReaderInstance(TIFFImageReaderSpi.java:116)
at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:529)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:513)
at com.aspose.pdf.internal.p657.z1$z4.m1(Unknown Source)
at com.aspose.pdf.internal.p657.z1$z1.m1(Unknown Source)
at com.aspose.pdf.internal.p657.z1$z1.m1(Unknown Source)
at com.aspose.pdf.internal.p657.z1.m4(Unknown Source)
at com.aspose.pdf.internal.p618.z30.m1(Unknown Source)
at com.aspose.pdf.XImageCollection.m1(Unknown Source)
at com.aspose.pdf.XImageCollection.m1(Unknown Source)
at com.aspose.pdf.XImageCollection.m2(Unknown Source)
at com.aspose.pdf.XImageCollection.m1(Unknown Source)
at com.aspose.pdf.XImageCollection.m1(Unknown Source)
at com.aspose.pdf.XImageCollection.m1(Unknown Source)
at com.aspose.pdf.XImageCollection.m1(Unknown Source)
at com.aspose.pdf.XImageCollection.m2(Unknown Source)
at com.aspose.pdf.SignatureField.m1(Unknown Source)
at com.aspose.pdf.SignatureField.sign(Unknown Source)
at com.aspose.pdf.facades.PdfFileSignature.m1(Unknown Source)
at com.aspose.pdf.facades.PdfFileSignature.save(Unknown Source)
at com.aspose.pdf.facades.PdfFileSignature.save(Unknown Source)
at signpdf.sign(signpdf.java:39)
Et le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| import java.io.*;
import com.aspose.pdf.Document;
import com.aspose.pdf.DocSaveOptions;
import com.aspose.pdf.facades.PdfFileSignature;
import com.aspose.pdf.PKCS1;
public class signpdf
{
public static void sign(String filename)
{
try
{
com.aspose.pdf.License pdfLicense = new com.aspose.pdf.License();
pdfLicense.setLicense(par.repSign + "Aspose.Total.Java.lic");
Document doc = new Document(filename);
// Add a page to PDF document
doc.getPages().add();
OutputStream out = new java.io.ByteArrayOutputStream();
// Save document to Stream object
doc.save(out);
// Create PdfFileSignature instance
PdfFileSignature pdfSignSingle = new PdfFileSignature();
// Bind the source PDF by reading contents of Stream
pdfSignSingle.bindPdf(new ByteArrayInputStream(((ByteArrayOutputStream) out).toByteArray()));
// Sign the PDF file using PKCS1 object
pdfSignSingle.sign(doc.getPages().size(), "Document numérisé conforme à l'original", "DSI", "Etablissement", true,
new java.awt.Rectangle(30, 780, 500, 50), new PKCS1(par.repSign + par.certFile, par.certPwd));
// Set image for signature appearance
pdfSignSingle.setSignatureAppearance(par.repSign + "cadenat-sign.png");
// Save final output
System.out.println("Signature de : " + filename);
pdfSignSingle.save(filename);
}
catch (Exception e)
{
e.printStackTrace();
}
}
} |
Quelqu'un serait-il en mesure de me porter secours ?
Mes recherches en ligne n'aboutissent pas ...
Merci