On 5/04/2011 12:02, Paulo Soares wrote:
Use bouncycastle 1.38.

Or 1.45 but the jdk15 versions, not the jdk16 ones
Paulo

-----Original Message-----
From: andyrobb18 [mailto:[email protected]]
Sent: Tuesday, April 05, 2011 8:13 AM
To: [email protected]
Subject: [iText-questions] java.lang.NoClassDefFoundError: 
org/bouncycastle/asn1/ASN1OctetString

This may be a stupid post, but as a relative java newbie I'm really stuck
here.

I'm developing integration for pdf forms into our companies reporting
architecture, and I'm trying to test using iText to see if it will meet our
requirement.

I've created the following java program:

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.io.InputStream;

import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.AcroFields;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import com.itextpdf.text.pdf.FdfReader;
import com.itextpdf.text.pdf.PdfEncryption;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

public class ImportFDF {
public static void main (String[] args) {
try
{
String in_pdf = args[0];
String in_fdf = args[1];
String out_pdf = args[2];
PdfReader reader = new PdfReader(in_pdf);
PdfStamper stamp = new PdfStamper(reader, new
FileOutputStream(out_pdf));
FdfReader fdf = new FdfReader(in_fdf);
AcroFields form = stamp.getAcroFields();
form.setFields(fdf);
stamp.setFormFlattening(true);
stamp.close();
}
catch (Throwable t)
{
    t.printStackTrace();
}
}
}


I'm able to compile this fine using the command below (all jars are in the
same directory from which I'm executing the command):

javac -cp ".;iText-5.0.6.jar;bcmail-jdk16-146.jar;bcprov-jdk16-146.jar"
ImportFDF.java


But when I run the following command (again all files in same directory) I
get the error below:

java -cp .;iText-5.0.6.jar;bcmail-jdk16-146.jar;bcprov16-146.jar ImportFDF
input.pdf input.fdf x.pdf

java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1OctetString
         at com.itextpdf.text.pdf.PdfEncryption.(PdfEncryption.java:138)
         at
com.itextpdf.text.pdf.PdfReader.readDecryptedDocObj(PdfReader.java:76
3)
         at com.itextpdf.text.pdf.PdfReader.readDocObj(PdfReader.java:1134)
         at com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:512)
         at com.itextpdf.text.pdf.PdfReader.(PdfReader.java:172)
         at com.itextpdf.text.pdf.PdfReader.(PdfReader.java:161)
         at ImportFDF.main(ImportFDF.java:23)
Caused by: java.lang.ClassNotFoundException:
org.bouncycastle.asn1.ASN1OctetStri
ng
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         ... 7 more

This is all using Java 16

Help!!!

Thanks
Andy

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/java-lang-NoClassDefFoundError-org-bouncycastle-asn1-ASN1OctetString-tp3427288p3427288.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Aviso Legal:

Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem.



Disclaimer:

This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.





------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev


_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


--

Kind Regards
Balder

------------------------------------------------------------------------
redlab-log <http://www.redlab.be/blog/>
@redlabbe <http://twitter.com/redlabbe>
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to