This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes ExceptionInInitializeError  in sevlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » Servlets
Bookmark "ExceptionInInitializeError  in sevlets" Watch "ExceptionInInitializeError  in sevlets" New topic

ExceptionInInitializeError in sevlets

Raji Balakrishnan

Joined: Jan 19, 2005
Posts: 5

I have a problem I don't understand:
Let's say I have a Servlet-Class with HttpServlet as it's supertype for
example package.MyServlet.
If I try to run a Servlet containing the code: package.MyServlet.class I
have no problem.
If I try to run my test application containing: package.MyServlet.class
I get an ExceptionInInitializeError the first time and NoClassDefFound's
when I try a second time.

Has this something to do with security or something ?
Thanks for your help
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62101

It usually means that an exception is being thrown during the static initialization of the class. Check your logs carefully and inspect any static code you have defined.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: ExceptionInInitializeError in sevlets