Tomcat startup half-flash problem solved

Source: Internet
Author: User

The recent contact with Tomcat is not yet well understood. In these days, encounter a Tomcat startup flashback problem, through the access to various materials, is a perfect solution. Share it with your friends here.


First, determine where your problem is. There are two methods, you can go through the log to query, you can also go directly to the general processing program to start.

1. Query Error:win+r input cmd, enter the general handler. Find your Tomcat Bin folder by CD, enter Startup.bat run under Bin, run, if prompted, missing java_home or missing Jre_home (). indicates that your environment variable is not correct, or that the environment variable is missing.


2. Solution: See through the command line prompt, this is because the computer is not configured Java_home or jre_home caused. Then add the Java_home and Jre_home below. To do this, click Properties, Environment variables, and then add system variables:


After adding the Java_home and jre_home two system variables, place the two variables in the path system variable by appending ";%java_home%;%jre_home%" directly after the value of the path variable, noting that the semicolon is the partition symbol for the environment variable, No less.

After Setup, OK, save, restart the general handler. Continue to run step one, at this time the results of the operation, generally as follows: If your Tomcat can start, then congratulations, the problem solved!

      3. If, after booting to this step, tomcat boots into the middle and there is an error, then we will go through the log to query for errors. Go to logs in the Tomcat root directory and find the corresponding Catalina.2015-0*-**.log, where you will see warnings and errors. As shown below:

Warning: couldn ' t initialize Jasperjava.lang.noclassdeffounderror:javax/servlet/jsp/jspfactoryat JAVA.LANG.CLASS.FORNAME0 (Native Method) at Java.lang.Class.forName (class.java:344) at Org.apache.catalina.core.JasperListener.lifecycleEvent (jasperlistener.java:63) at Org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent (lifecyclesupport.java:117) at Org.apache.catalina.util.LifecycleBase.fireLifecycleEvent (lifecyclebase.java:90) at Org.apache.catalina.util.LifecycleBase.setStateInternal (lifecyclebase.java:402) at Org.apache.catalina.util.LifecycleBase.init (lifecyclebase.java:99) at Org.apache.catalina.startup.Catalina.load ( catalina.java:638) at Org.apache.catalina.startup.Catalina.load (catalina.java:663) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:62) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:483) at Org.apache.Catalina.startup.Bootstrap.load (bootstrap.java:280) at Org.apache.catalina.startup.Bootstrap.main (Bootstrap.java : 454) caused By:java.lang.ClassNotFoundException:javax.servlet.jsp.JspFactoryat java.net.urlclassloader$1.run ( urlclassloader.java:372) at Java.net.urlclassloader$1.run (urlclassloader.java:361) at Java.security.AccessController.doPrivileged (Native Method) at Java.net.URLClassLoader.findClass ( urlclassloader.java:360) at Java.lang.ClassLoader.loadClass (classloader.java:424) at Java.lang.ClassLoader.loadClass (classloader.java:357) ... July 19, 2015 3:26:10 pm org.apache.coyote.AbstractProtocol init info: Initializing protocolhandler ["http-bio-8080"] July 19, 2015 3:26:10 pm org.apache.coyote.AbstractProtocol init info: Initializing protocolhandler ["ajp-bio-8009"] July 19, 201 5 3:26:10 pm Org.apache.catalina.startup.Catalina Load Info: Initialization processed in 952 MS July 19, 2015 3:26:10 pm Org.apa Che.catalina.startup.Catalina start Critical: The required Server component failed to start so Tomcat is Unable to start.org.apache.catalina.LifecycleException:Failed to start component [Standardserver[8005]]at Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:154) at Org.apache.catalina.startup.Catalina.start (catalina.java:689) at Sun.reflect.NativeMethodAccessorImpl.invoke0 ( Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:62) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:483) at Org.apache.catalina.startup.Bootstrap.start (Bootstrap.java : 321) at Org.apache.catalina.startup.Bootstrap.main (bootstrap.java:455) caused by:java.lang.NoClassDefFoundError: Org/apache/commons/logging/logfactoryat org.apache.naming.namingcontext.<clinit> (NamingContext.java:58) at Org.apache.catalina.core.NamingContextListener.lifecycleEvent (namingcontextlistener.java:252) at Org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent (lifecyclesupport.java:117) at Org.apaChe.catalina.util.LifecycleBase.fireLifecycleEvent (lifecyclebase.java:90) at Org.apache.catalina.core.StandardServer.startInternal (standardserver.java:731) at Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150) ... 7 morecaused By:java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactoryat java.net.urlclassloader$ 1.run (urlclassloader.java:372) at Java.net.urlclassloader$1.run (urlclassloader.java:361) at Java.security.AccessController.doPrivileged (Native Method) at Java.net.URLClassLoader.findClass ( urlclassloader.java:360) at Java.lang.ClassLoader.loadClass (classloader.java:424) at Java.lang.ClassLoader.loadClass (classloader.java:357) ... More
4. Solution: This error, troubled me for a long time, has been unable to find a solution, online access to a lot of information, there is no way to solve. Finally, in the corner of a forum, a solution was found. The main reason for this error is that logfactory cannot be found, and there are many possibilities for this error, one of which is that you have added a duplicate jar package, or a similar function jar package underneath the bin of the JDK, resulting in duplication, There is also the bug caused by the jar package added under Tomcat's bin. I added a javaee.jar below the JDK to resolve the error that occurred at the time that the javac was not an internal command. Causes Tomcat to fail halfway through the boot.

Learning is continuing, Tomcat research is also in progress, learning, summing up, sharing, if there are errors, please correct, thank you!



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Tomcat startup half-flash problem solved

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.