If you are working on a web application based on spring which requires use of org.springframework.web.context.ContextLoaderListener
in web.xml file and you are getting this exception when you start the server. This exception is more likely when you are working on eclipse or possibly on other such IDE.
Exception log trace will look like this:
org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
Solution:
Reason 1:
Possibly you have not added the spring web dependencies in your project. Just add them if you have not.
Reason 2:
If you are still getting this exception then you must add these dependencies to project deployment assembly as well.
To add dependencies in deployment assembly follow below instructions.
1) Open project properties and select Choose Deployment Assembly. Then select option “Java Build Path Entries”.

2) Click Next and select all jar files. Click Finish.

3) Deployment assembly will look like this. Click Apply.

The ContextLoaderListener is used to integrate Spring with other web application.
Below is an example configuration in web.xml
<!-- file : web.xml -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/Spring/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
And the common error message is, your server can not find this Spring ContextLoaderListener class during the server start up.
Try above fixes will help solve the issue.
More details here: https://howtodoinjava.com/spring-core/solved-java-lang-classnotfoundexception-org-springframework-web-context-contextloaderlistener/
Good to refer: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener