Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

exception

 
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)
 
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]
 
Bartender
Posts: 4568
9
  • 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: 4568
9
  • 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).
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!