Tomcat problem summary

Source: Internet
Author: User

1. how to load a war package in Tomcat and a decompressed project with the same name??

First, you must understand when the war package will be decompressed,When Tomcat is started, it will view all war packages under webapps and check whether the war package exists.The corresponding decompressed file will not be decompressed if it already exists, and will not overwrite the modified JSPOnly after you delete the folder of the same name (your project) corresponding to the war package will you decompress the war file after starting tomcat.

 

 

2. Tomcat can access the default page, but cannot access the specified project under webapp

Conf/Web. xml --> Tomcat web configuration file

<Init-param>

<Param-Name> listings </param-Name>

<Param-value> false </param-value>

</Init-param>

Change Value to true!

<Init-param>

<Param-Name> listings </param-Name>

<Param-value> true </param-value>

</Init-param>

 

 

3. When the project's testproject JS and CSS are directly modified under Tomcat's webapp, access to the page does not work. Why ??

Tomcat deployment is sometimes a problem,If hot deployment is not used, we can only re-deploy the original file once without modifying it once, and shut down Tomcat for each re-deployment. After the deployment is complete, restart tomcat.It can be seen how troublesome this is. Now, we can adopt hot deployment. In the future, we don't need to restart and close people.

 

Implementation Method:

Edit the TomcatServer. xmlFile

XML Code
  1. <Host name = "localhost" DEBUG = "0" appbase = "webapps"
  2. Unpackwars = "true" autodeploy = "true"
  3. Xmlvalidation = "false" xmlnamespaceaware = "false">

 

Add:

XML Code
  1. <Context Path = "/requesttest" docbase = "D: \ apache-Tomcat-6.0.33 \ webapps \ testproject" DEBUG = "99" reloadable = "true"/>

 

"MyApp" is the application to be deployed, usually in the webapps directory.

 

Attributes of the context element:

Path: SpecifiesURL entry.

Docbase: SpecifiesWeb application file pathYou can give an absolute path or a relative path relative to the appbase attribute of

 

Reloadable: If this propertySet true to monitor changes to the class files under the WEB-INF/class and web-infb directories in the running state of the Tomcat containerIf a class file is detected to be updated, the server automatically reloads the web application, that is, it is automatically deployed.

 

Setting the reloadable attribute to true in the development phase will help debug Servlet and other class files, but this will increase the load on the server. We recommend that you set reloadable to false in the development phase of Web applications.

 

Note:

After the change, visit the next page. sometimes only the change may not be automatically deployed.

 

 

4. memory overflow when started directly using startup. bat

 

InCatalina. batJoin

Set java_opts =-xms256m-xmx512m-XX: permsize = 64 m-XX: maxpermsize = 128 m

 

However, if you do not execute startup. BAT to start TomcatStart the Tomcat service using Windows system services. The above settings do not take effect.Now

 

 

Tomcat problem summary

Related Article

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.