0

I'm working with Spring security and Hibernate, but I am getting the following problem in the xml file spring-security.xml

Description Resource Path Location Type Error occured processing XML

Could not initialize class org.springframework.security.config.http.MatcherType'. See Error Log for more details    spring-security.xml /testholding/WebContent/WEB-INF line 9  Spring Beans Problem

The problem is the HTTP /HTTP of spring-security.xml

I need help please!

Oomph Fortuity
  • 5,710
  • 10
  • 44
  • 89
  • Welcome to Stack Overflow, please take the [Tour](http://stackoverflow.com/tour). Post your code, see [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – DavidPostill Aug 19 '14 at 17:24
  • Can you please post the content of your `spring-security.xml` as well as the dependencies you are using? – geoand Aug 26 '14 at 06:18

1 Answers1

0

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.

Luke Woodward
  • 63,336
  • 16
  • 89
  • 104