Solve a Tomcat startup problem for a long time ah, from yesterday day to get today noon to solve, before about Tomcat is actually a rookie, stepped on a few pits.
A summary of my resolution process, from Baidu Step-by-step search out:
First, I ran the startup.bat directly in Tomcat, flashed through, started with Eclipse, and the server Tomcat v7.0 server at localhost failed to start was the error. First, at least run Startup.bat to print the error message on CMD. Notepad opens the Startup.bat, and finds the last word:: End, we know that end means the ending,: End is a token, we add a pause to the back (the meaning of pause waiting);
Execute the Startup.bat again, you will see the figure, when we press any key when the cmd window is a flash past. But this has determined that our environment variables are correct.
To see the information in more detail, let's change one sentence: Find the call "%executable%" start%cmd_line_args% replace the inside start with run. Then look at the CMD window output error message:
Error occurred during initialization of VM could not reserve enough space for object heap could not create the Java Virtua L Machine
We can generally understand that the VM program exits because the program does not request enough memory to initialize.
Solution: Well, now that we've found the cause, we can solve the problem: apply enough memory to it.
Do the following: In Catalina.bat find the Execute the requested command below
Set Java_opts to replace this sentence with the following:
Set java_opts=-server-xms800m-xmx800m-xx:maxnewsize=256m
There are a lot of ways to replace the set java_opts, but it's basically the same thing.
Start again Startup.bat will see the picture we have been waiting for for a long time.
The launch was successful.
Unfortunately, this is not the reason I met:
The reason I met is:
An incompatible version 1.1.12 of the APR based Apache Tomcat Native Library are installed, while Tomcat requires version 1 .1.32
Workaround:
You replaced the 1.1.30 version before you are sure that you have deleted all the old versions. To know that Windows likes to copy a copy of a DLL under a hidden directory under System32 (specifically which DLL will be copied here I'm not sure, you have to check it manually, Windows\System32 search once, remove all the same name), Hidden Oh, You need to display it in the folder options and delete those cached versions as well.
Save the following text as a search.bat:
@ echo File%1 is found at%~dp$path:1 |
Then enter the command:
C:\>search Jscript.dll File Jscript.dll is found at C:\WINDOWS\system32\ |
We can use it to find out which directory your DLL was found in, every time you delete a DLL and run it again this command checks which directory has it. Make sure you don't have any more than the Tomcat\bin directory, and then put your latest version under Tomcat\bin. Then download a tcnative-1.dll, the version is 1.1.32 installed under c://windows/system32/, in the Tomcat\bin and put one. Start
The problem is solved for the more than half.
Then when you start the project with Eclipse, there is a child ... This question
The reason is that there is a problem with the project configuration deployed on Tomcat, so it's good to remove the problematic items.
There is also the problem of 8080 ports being occupied:
You can enter Netstst-ano in cmd, and then find out if the 8080 port is listening
If it is, find the back PID number, write it down, then go to start Task Manager, locate the service, then find the process and end the process. Of course, this process is generally javaw.exe.
Double click
Increase start time is good, of course, I have not encountered this problem