The message Could not initialize class SomeClass
means that the JVM has already tried and failed to statically initialize the class SomeClass
. If you restart your web application container and make another attempt to reproduce the error, you may get a different message the first time.
Static initialization of a class consists of running any static { }
blocks and assigning values given to any static
fields. In the case of the MatcherType class mentioned in your error message, the static initialization is as follows:
private static final Log logger = LogFactory.getLog(MatcherType.class);
private static final String ATT_MATCHER_TYPE = "request-matcher";
private static final String ATT_PATH_TYPE = "path-type";
The two string constants won't be a problem. However, the first one is where I suspect the problem to be. The method LogFactory.getLog
is in Apache Commons Logging.
My bet is therefore that your web application is missing the commons-logging jar. Try adding that and seeing if it makes a difference.