0

I am developing one login form but I'm getting this catalina lifecycle exception.

This is my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
    <display-name>LoginWithSpringMVC</display-name>
    <servlet>
        <servlet-name>spring</servlet-name>    
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>
Antti29
  • 2,953
  • 12
  • 34
  • 36
Yuvanath
  • 127
  • 3
  • 11
  • Try 1) Stop the server2) Clean Tomcat's work directory – sForSujit Jul 15 '17 at 06:45
  • yeah i tried that many time still am getting same problem @sForSujit – Yuvanath Jul 15 '17 at 06:52
  • java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/HomeBankingSystem]] at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1119) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:8 – Yuvanath Jul 15 '17 at 06:53
  • this is the exception am getting – Yuvanath Jul 15 '17 at 06:53
  • Can you try https://stackoverflow.com/questions/10556201/java-lang-classnotfoundexception-httpservletrequest – sForSujit Jul 15 '17 at 06:59
  • i found the issue..the problem is name mismatch in between and tags.. thank for you respose :) – Yuvanath Jul 15 '17 at 07:15
  • Glad you able to solve issue – sForSujit Jul 15 '17 at 07:18

2 Answers2

1

As far as logs, you'll often get the most information in "logs/catalina.yyyy-mm-dd.log", however sometimes when an application fails to start you will also get information in "logs/localhost.yyyy-mm-dd.log". In addition to that, you might have application specific logs that you can check or if the app is writing to STDOUT/STDERR you can check "logs/catalina.out" to get them.

1

and May check JVM class loader issue. If you have multiple JAR files in the same directory with the same class in them (perhaps version A and version B of a library), there is no defined order in which the JAR files will be searched. On some platforms, A might get searched first, on others B might get searched first. Usually it's consistent for a platform, but it can technically change from run to run. The simple answer to this is don't leave old WAR files in the "lib" directory (or anywhere else on the class path). A way to troubleshoot this when it happens is to run your tc Server with the JVM options "-verbose". This will print the location from which the JVM loads a class file. You can then use that to find the offending libraries.

follow the stamps:

The first thing to verify is that this class exists and is on the class path. That is the most obvious cause of this error. Check the JAR files bundled in your WAR file and confirm that it exists there.

The second thing I would do is add the "-verbose" option that I mentioned above. This will help you to figure what classes are being loaded and from where. After you do this check if there are any more old JAR files being used, if so remove them. After that, take a look at the classes being loaded before error is generated. These are likely to be triggering the JVM to load this class. Look at the JAR file from which these classes are being loaded and make sure it's the right version. Often NoClassDefFoundError will occur when two different versions of a JAR file are being used.

Third thing you should do is take a look at the verbose output and look for class files being loaded from JAR files in the top level "lib" directory of your tc Server instance. While this is technically OK, it almost always leads to difficult to diagnose class loader issues what may be happening here. That said, the recommended place to put 99% of your JAR files is in the "WEB-INF/lib" directory of your WAR file. The only ones you want to put in the top level "lib" directory are JDBC and resources drivers that are needed by Tomcat (i.e. because you've configured a tag in your configuration).

Lastly, it looks like these are being triggered by servlet 3.0 annotation processing. In other words, Tomcat is scanning your application for servlet 3.0 annotations. During this process, it's triggering the errors. If you're not using functionality from servlet 3.0, you can disable it. More on this can be see in the Tomcat docs here, it applies equally for tc Server.