wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "exception" Watch "exception" New topic
Author

exception

rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
how to remove thie exception....


Exception in thread "main" java.lang.NullPointerException
at com.itextpdf.text.pdf.PdfSignatureAppearance.getAppearance(PdfSignatureAppearance.java:409)
at com.itextpdf.text.pdf.PdfSignatureAppearance.preClose(PdfSignatureAppearance.java:950)
at com.itextpdf.text.pdf.PdfSignatureAppearance.preClose(PdfSignatureAppearance.java:897)
at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:192)
at signature.sig.main(sig.java:81)
Arunkumar Chinnadurai
Ranch Hand

Joined: Dec 15, 2011
Posts: 56

rakhi sinha wrote:how to remove thie exception....


Exception in thread "main" java.lang.NullPointerException
at com.itextpdf.text.pdf.PdfSignatureAppearance.getAppearance(PdfSignatureAppearance.java:409)
at com.itextpdf.text.pdf.PdfSignatureAppearance.preClose(PdfSignatureAppearance.java:950)
at com.itextpdf.text.pdf.PdfSignatureAppearance.preClose(PdfSignatureAppearance.java:897)
at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:192)
at signature.sig.main(sig.java:81)


Please check the sig.java file in 81st line..
rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
Arunkumar Chinnadurai wrote:
rakhi sinha wrote:how to remove thie exception....


Exception in thread "main" java.lang.NullPointerException
at com.itextpdf.text.pdf.PdfSignatureAppearance.getAppearance(PdfSignatureAppearance.java:409)
at com.itextpdf.text.pdf.PdfSignatureAppearance.preClose(PdfSignatureAppearance.java:950)
at com.itextpdf.text.pdf.PdfSignatureAppearance.preClose(PdfSignatureAppearance.java:897)
at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:192)
at signature.sig.main(sig.java:81)


Please check the sig.java file in 81st line..

I am using following code but sign.pdf of 0kb is being created.....




[Added code tags - see UseCodeTags for details]
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4344
    
    8

You create a Document object on 27, close it on lone 81, but in between you never actually do anything with it, so it's a completely empty document. That's why you're getting the exception. It's probably related to the reason you're getting an empty PDF as well, because it suggests there's something you ought to be doing that you've omitted.
rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
Matthew Brown wrote:You create a Document object on 27, close it on lone 81, but in between you never actually do anything with it, so it's a completely empty document. That's why you're getting the exception. It's probably related to the reason you're getting an empty PDF as well, because it suggests there's something you ought to be doing that you've omitted.


but between these lines i am putting signature on this document.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4344
    
    8

rakhi sinha wrote:but between these lines i am putting signature on this document.

Where? Where do you do it on this document? Because the variable document isn't referred to between those lines (except on lines 28/29, but you've commented those out).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception
 
Similar Threads
WA #1.....word association
counting algorithm
void return type in JSP expression
why JMX can not stop
Java ranch rules roundup