I am trying to start my web application on Tomcat 7, but whenever I click on the start button, I get this error:
FAIL - Application at context path /Web c
SEVERE: Error listenerStart
This boils down to that a ServletContextListener
which is registered by either @WebListener
annotation on the class, or by a
declaration in web.xml
, has thrown an unhandled exception inside the contextInitialized()
method. This is usually caused by a developer's mistake (a bug) and needs to be fixed. For example, a NullPointerException
.
The full exception should be visible in webapp-specific startup log as well as the IDE console, before the particular line which you've copypasted. If there is none and you still can't figure the cause of the exception by just looking at the code, put the entire contextInitialized()
code in a try-catch
wherein you log the exception to a reliable output and then interpret and fix it accordingly.