In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "startup.bat start Tomcat flashback reasons and how to solve", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "startup.bat start Tomcat flashback reasons and how to solve" it!
There is a problem:
After installing Tomcat, I began to use it well. Inexplicably, some metaphysical problems suddenly appeared. One time, when I double-clicked startup.bat to start Tomcat, my black window was running disgracefully and then retreated. I could see an exception vaguely, but I had just seen a caused by.... The black window has been closed. After restarting the computer and other conventional ways to solve the problem, it is still unable to solve the problem.
Analyze the problem
Since the problem flashed after this startup, take a look at what was done at startup. Open startup.bat with notepad and you will find a line of script that reads as follows:
Set "EXECUTABLE=%CATALINA_HOME%\ bin\ catalina.bat"
You can see that it has accessed the catalina.bat script in this directory, so notepad opens catalina.bat and finds that these contents appear again:
Rem Get standard Java environment variables
If exist "% CATALINA_HOME%\ bin\ setclasspath.bat" goto okSetclasspath
Echo Cannot find "% CATALINA_HOME%\ bin\ setclasspath.bat"
Echo This file is needed to run this program
Goto end
: okSetclasspath
Call "% CATALINA_HOME%\ bin\ setclasspath.bat" 1
If errorlevel 1 goto end
This shows that catalina.bat visited the setclasspath.bat in this directory, while notepad opened setclasspath.bat and found that it visited catalina.bat again.
To sum up, it is found that the startup process of startup.bat is: startup- > catalina- > setclasspath- > catalina.
Reason for flashback:
It can be seen that none of the three files can go wrong. Analyze these three documents and find out the main cause of the flashback problem.
Reason 1: there is something wrong with the java environment variable
It can be seen from the startup script that Tomcat has accessed the environment variable information many times, including the java environment (after all, the Tomcat source code is also java). Therefore, we should first check the environment configuration of jdk.
Note: CATALINA_HOME is a Tomcat environment, you can choose not to configure it, but then you can only start Tomcat in the bin directory. In other words, after configuring the Tomcat environment, you can copy the startup.bat somewhere else and double-click to start it.
Reason 2: Port occupancy
If Tomcat is already started or port 8080 is occupied, this is naturally not allowed.
You can visit localhost:8080 directly to see if you can access Tomcat. If you can, it means that it has already been opened. You can double-click shutdown.bat to close it.
Or you can execute netstat-ano in the black window | findstr "8080" to check the status of port 8080. If it is TIME_WAIT, it means it is not occupied.
Reason 3: your Tomcat is not clean.
If it hasn't been solved yet, it's possible that the Tomcat you downloaded is some castrated or deformed goods such as green version, invincible version, xx version and so on. At this point, you can open startup.bat in notepad, add pause to the last line of the script, and start breakpoint debugging after saving it. (it doesn't have to be added to the penultimate line in my picture, and the last line should be fine, as long as it's not in the previous logic.)
The startup effect at this time is no different from that before, but it will not flash immediately after something goes wrong, but you will exit only after you press any key in the window. OK! Now you can study your own bug (remember to delete the pause after solving the problem)!
Thank you for your reading, the above is the "startup.bat start Tomcat flashback reasons and how to solve" the content, after the study of this article, I believe that you have a deeper understanding of the reasons for startup.bat startup Tomcat flashback and how to solve this problem, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.