Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception

 
rakhi sinha
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 56
Android MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4566
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4566
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic