This page shows errors where an java.lang.NoClassDefFoundError exception is thrown and how to fix them.
java.lang.NoClassDefFoundError: Could not initialize class org.apache.struts.taglib.html.HtmlTag sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) ...
This exception occurs due to an inability to initialize the Struts HtmlTag tag. Depending on which tag library is used first, different struts tags may also report they cannot initialize. The first one referenced is the one that throws the exception.
The real error is that while trying to initialize, Struts tried to attach to a Logger and the Logger was not initialized, usually this is a log4j properties file error.
SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.LogManager at org.apache.log4j.Logger.getLogger(Logger.java:85) at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229) at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351) at org.apache.struts.util.MessageResources.<clinit>(MessageResources.java:57) at org.apache.struts.taglib.html.HtmlTag.<clinit>(HtmlTag.java:48) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ...
This is caused by log4j not being correctly initialized.