Note: The context. xml file of this version cannot be modified. It indicates that the file is read-only, but not in attributes.
Raloadable = "true", not modified
PS: Clicking startup. bat in the Tomcat folder is a way to start the Tomcat server. But pay attention to the information displayed in the command prompt, which may indicate any errors and is very serious,
However, it does not affect opening the welcome interface. In this case, you cannot ignore the problem. For example, the first version of my system requires many problems, but it does not affect the video, the teacher seems to have problems,
So it has led to so many tragedies!
The following are some useful articles found in the problem solving process. You can easily solve the problem later.
Citation of related content
Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Reference address: http://blog.csdn.net/xttgx/archive/2009/11/15/4813044.aspx csdn blog
About the problem that Tomcat is automatically disabled immediately after it is started
Today, I spent some time searching for the reason why Tomcat can be started in myeclipse, and I directly clicked the Tomcat 5.exe or satartup. bat in the Tomcat folder but it cannot be started.
The error shown in the Tomcat log is [16:02:05] [924 prunsrv. C] [Error] failed creating Java;
[16:02:05] [1179 prunsrv. C] [Error] servicestart returned 1. Cut the two sentences and paste them to Google. The answer is:
The mvcr71.ddl file is placed in system32 of windows. I copied the file and prompted that the file exists and the update date was modified. So I gave up copying.
Some people say that the reason for JDK is that myeclipse can be started because myeclipse uses its own JRE. jdk jre may be faulty. I tried to back up the JRE file in JDK,
Then, copy the JRE file of myeclipse to overwrite the JRE file in JDK. Running Tomcat's startup still won't work.
Then, let's take a look at another message and borrow some inspiration: dos -- cmd -- D: -- CD tomcat/bin -- startup. bat. The following prompt appears after you press Enter:
Neither the java_home nor the jre_home environment variable is defined
At least one of these environment variable is needed to run this program
With these two questions, Google got a useful message:Java_home is a special variable, which is not required in most cases. However, if you install some server software or development tools, such as Tomcat or ant, you will need it.
Then, I configured the java_home environment variable and ran startup. bat, yeah! OK!
The following describes how to configure JDK environment variables:
The variable name java_home is assigned "<JDK installation path directory>", for example, "C: \ JDK ;";
Variable name classpath value ".; % java_home % \ Lib \ tools. jar; % java_home % \ Lib \ DT. jar ;";
(* Note: % java_home % can be replaced by <JDK installation path directory>. In fact, % java_home % is the above variable .)
Variable PATH value: "% java_home % \ bin ;";
For example, this is where JDK is located: D: \ jdk1.5.0
Configure environment variables:
Java_home: D: \ jdk1.5.0
Path: D: \ jdk1.5.0 \ bin;
Classpath:.; D: \ jdk1.5.0 \ Lib \ tools. jar;
After reading it, I modified my Java environment, but it still failed!
Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Citation address: http://www.oelandau.com/viewnews-5648
The problem is as follows:
After Tomcat is installed, it can be started successfully. You can go to the welcome page and close tomcat. After Tomcat is configured in myeclipse-> service, it can be started,
Restart Tomcat on your computer and you will see the problem of automatic shutdown after startup.
The solution is as follows:
After myeclipse-> service starts tomcat, you can view the port and find that javaw occupies ports 80, 8009, so that all Tomcat default ports are occupied,
Tomcat cannot be enabled on the computer. The solution is to change all ports 8009, 8008, and in server. XML in the conf file of the tomcat installation file (for example ),
In this way, the problem of starting Tomcat is solved. Check that ports 80, and are all in the listening status. There is no conflict between Tomcat and JDK versions,
This problem was not encountered before using myeclipse7.0. This time, myeclipse8.5 and myeclipse6.0 have all encountered this problem. It is recorded here for future use!
Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Citation address: http://blog.csdn.net/hansoft/archive/2006/04/01/647060.aspx csdn blog
How to run multiple Tomcat instances
If you need to deploy an Alpha web application to Tomcat on a machine for testing, and tomcat on this machine also runs other important web applications, what do you do?
Obviously, it cannot be simply put together with important web applications. In this case, the crash of Alpha applications will make other applications unable to work at the same time, because they run on the same JVM.
In this case, you should install another tomcat so that the alpha version of the application runs in this tomcat. In this case, you need to modify CONF/server. xml so that the ports occupied by the two Tomcat servers are different,
By default, Tomcat uses three ports:
- Shutdown port: <server port = "8005" shutdown = "shutdown">
- Http port: <connector Port = "8080" maxhttpheadersize = "8192" maxthreads = "150" minsparethreads = "25" maxsparethreads = "75" enablelookups = "false" redirectport = "8443" acceptcount =" 100 "connectiontimeout =" 20000 "disableuploadtimeout =" true "/>
- AJP port: <connector Port = "8009" enablelookups = "false" redirectport = "8443" protocol = "AJP/1.3"/>
In this way, not only the applications in the two Tomcat servers do not affect each other, but also the two Tomcat programs can be upgraded separately. However, if we want the two web applications to run on different JVMs,
However, the tomcat version used must be the same. This method is a little troublesome, because if you want to upgrade the tomcat version, you must upgrade both. In fact, Tomcat can run multiple instances in a program version:
Tomcat has an environment variable catalina_base, which is used to specify a directory. Tomcat implements most of the startup work based on the contents of this directory, including loading the web app that we are most concerned about, the Directory consists of conf, logs, shared, webapps, work, and temp subdirectories. In this way, create a directory for each instance and configure its content (note that you also need to modify server. XML to make the port different ),
Then, when each instance is started, the catallina_base is directed to the corresponding directory of the instance, so that multiple instances can be started. You can write a startup. BAT file in the directory corresponding to the instance.
This script uses the directory where the script is located as catalina_base. It can run in any directory and retains the parameters of the Tomcat STARTUP script:
@ Echo off set cmd_line_args =: setargs if "" % 1 "" = "Goto donesetargs set __line_args = % cmd_line_args % 1
Shift goto setargs: donesetargs set executable = % catalina_home % \ bin \ Startup. BAT set catalina_base = % ~ Dp0
Call "executable" % __line_args %
It's a highly handwritten one. It's well written, but I just can't understand it. Simply put, it's just to change the port number. It's clear below.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Citation address: http://blog.csdn.net/jiaxy917/archive/2008/10/15/3075713.aspx csdn blog
Both Tomcat servers use ZIP files.
After installing the second tomcat, go to the conf subdirectory under the installation directory to open the server. xml file and find the following three places:
(1) modify the HTTP access port (port 8080 by default) <connector classname = "org. Apache. Coyote. tomcat4.coyoteconne" Port =" 8080"
Minprocessors = "5" maxprocessors = "75"
Enablelookups = "true" redirectport = "8443"
Acceptcount = "100" DEBUG = "0" connectiontimeout = "20000"
Useurivalidationhack = "false" disableuploadtimeout = "true"/>
(About 86 lines) Change 8080 to the port number that is not used by the First tomcat. The port number is used to access the Web.
(2) modify the shutdown port (default port 8005) <server port = "8005" shutdown = "shutdown" DEBUG = "0">
(About 13 rows) Change 8005 to a port number that is not in use, for example, 8095
(3) modify the JVM startup port (Port 8009 by default) <connector classname = "org. Apache. Coyote. tomcat4.coyoteconne"
Port = "8009" minprocessors = "5" maxprocessors = "75"
Enablelookups = "true" redirectport = "8443"
Acceptcount = "10" DEBUG = "0" connectiontimeout = "20000"
Useurivalidationhack = "false"
Protocolhandlerclassname = "org. Apache. JK. server. jkcoyotehandler"/>
(About 107 rows) Change 8009 to a port number that is not in use, such as 8099