Check whether you have multiple ContextLoader* definitions in your web.xml!

If you are using Spring in your web project and just added Spring Security, you may come across this error message when trying to start the application.

This is caused by Spring Security adding ContentLoaderListner to the project. To resolve this issue, locate in your code where ContentLoaderListner is defined. If you are using web.xml there should be a code similar to the following:

If using java configuration, locate code defining the listeners in you WebXml.java (or whatever file name you chose to give it). It’s that simple!