File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to handle ExceptionInInitializerError ?

 
jami siva
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Below is my code, in this iam unable to catch ExceptionInInitializerError, iam only to catch NullPointerException Only,
Can any one make edjustments to this code to handle ExceptionInInitializerError.
 
Lee Kian Giap
Ranch Hand
Posts: 213
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can't because ExceptionInInitializerError is a chaining exception.


maybe you can try to use
NullPointerException.getCause() to return a Throwable object and cast it to ExceptionInInitializerError





or a better approach is

 
jami siva
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Lee Kian Giap ,

I Understood this one.

Thank you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic