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 could not be started
and below lines are added to catalina.log
file:
Feb 08, 2012 7:21:01 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart Feb 08, 2012 7:21:01 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/Web] startup failed due to previous errors
How is this caused and how can I fix it?
I had a similar problem. The catalina.out logged this log Message
Apr 17, 2013 5:14:46 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart
Check the localhost.log in the tomcat log directory (in the same directory as catalina.out), to see the exception which caused this error.
SEVERE: Error listenerStart
This boils down to that a ServletContextListener
which is registered by either @WebListener
annotation on the class, or by a <listener>
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.
For Intellij Idea sometime localhost.log file generated at different location. For e.g. you can find it at homedirectory\ .IntelliJIdea14\system\tomcat.
IF you are using spring then start ur server in debug mode and put debug point in catch block of org.springframework.context.support.AbstractApplicationContext's refresh() method. If bean creation fails you would be able to see the exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With