A solution to the problem that the Tomcat service could not start

  • 2020-04-01 03:02:51
  • OfStack

In the second half of last year, the company decided to invest manpower and resources to "follow the trend" and do research in the direction of big data and apply it to subsequent projects, so we had to get familiar with Java.
Let's start with a JavaEE development environment. Install JDK, JRE, in fact, there are JRE under the JDK, if on the server, just install JRE; Then configure the environment variables:

New: JAVA_HOME: D:\Java\jdk1.7.0_51
New: CLASS_PATH:; % JAVA_HOME % \ lib
Edit: PATH: add %JAVA_HOME%\bin; Then install Tomcat, startup. Bat and shutdown.bat are all normal. Then, I want to turn the startup and shutdown of the compressed version of Tomcat into a Windows service for handling.

< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201402/2014228162638146.jpg" >

The Windows 2003 system on my previous desktop did not have what problem, how to arrive now this Win7 system on the small notebook so? Firstly, since the configuration of service. Bat, that is, the environment variable, can be normally invoked, there is no problem. Compared with the two operating systems, it seems that the most likely problem is the permission problem during installation. First uninstall the installed service.bat remove, then "run as administrator" cmd.exe, switch to the directory where service.bat is located and execute service.bat install to reinstall the Tomcat service. HoHo, this will start and close normally.
Since this is a development environment, we can configure a super user admin to manage Tomcat through "http://localhost:8080/". Enter the conf folder in Tomcat root directory, open "tomcat-users.xml" and edit it:


<tomcat-users>      
  <user username="admin" password="admin" roles="manager-gui,admin-gui"/>    
</tomcat-users>  

Once Tomcat is restarted, you can use admin to manage Tomcat.


Related articles: