Summary of tomcat release project problems

Source: Internet
Author: User

Summary of tomcat release project problems

A relatively old project has been maintained recently and needs to be released on Tomcat 7 after maintenance. The deployment process has encountered many problems. The following is a summary.

First question:

An error occurred while deploying the project in the morning. One page cannot be opened:

The following error is reported:

Severe: Servlet. service () for servlet jsp threw exception

Javax. el. ELException: The identifier [new] is not a valid Java identifier as required by section 1.19of the EL specification (Identifier: = Java language identifier ). this checkcan be disabled by setting the system property org. apache. el. parser. SKIP_IDENTIFIER_CHECKto true.

Atorg. apache. el. parser. AstDotSuffix. setImage (AstDotSuffix. java: 45)

Atorg. apache. el. parser. ELParser. DotSuffix (ELParser. java: 1069)

Atorg. apache. el. parser. ELParser. ValueSuffix (ELParser. java: 1035)

Atorg. apache. el. parser. ELParser. Value (ELParser. java: 980)

Atorg. apache. el. parser. ELParser. Unary (ELParser. java: 950)

Atorg. apache. el. parser. ELParser. Unary (ELParser. java: 894)

Atorg. apache. el. parser. ELParser. Multiplication (ELParser. java: 714)

Atorg. apache. el. parser. ELParser. Math (ELParser. java: 634)

Atorg. apache. el. parser. ELParser. Compare (ELParser. java: 446)

Atorg. apache. el. parser. ELParser. Equality (ELParser. java: 340)

Atorg. apache. el. parser. ELParser. And (ELParser. java: 284)

Atorg. apache. el. parser. ELParser. Or (ELParser. java: 228)

Atorg. apache. el. parser. ELParser. Choice (ELParser. java: 185)

Atorg. apache. el. parser. ELParser. Expression (ELParser. java: 177)

Atorg. apache. el. parser. ELParser. DynamicExpression (ELParser. java: 149)

Atorg. apache. el. parser. ELParser. CompositeExpression (ELParser. java: 46)

Atorg. apache. el. lang. ExpressionBuilder. createNodeInternal (ExpressionBuilder. java: 114)

Atorg. apache. el. lang. ExpressionBuilder. build (ExpressionBuilder. java: 171)

Atorg. apache. el. lang. ExpressionBuilder. createValueExpression (ExpressionBuilder. java: 216)

Atorg. apache. el. ExpressionFactoryImpl. createValueExpression (ExpressionFactoryImpl. java: 66)

Atorg. apache. jasper. runtime. PageContextImpl. proprietaryEvaluate (PageContextImpl. java: 966)

Atorg. apache. jsp. WEB_002dINF.jsp.collectionForm_jsp. _ jspx_meth_c_0051__005f0 (collectionForm_jsp.java: 595)

Atorg. apache. jsp. WEB_002dINF.jsp.collectionForm_jsp. _ jspService (collectionForm_jsp.java: 351)

Atorg. apache. jasper. runtime. HttpJspBase. service (HttpJspBase. java: 70)

Atjavax. servlet. http. HttpServlet. service (HttpServlet. java: 727)

Atorg. apache. jasper. servlet. JspServletWrapper. service (JspServletWrapper. java: 432)

Atorg. apache. jasper. servlet. JspServlet. serviceJspFile (JspServlet. java: 390)

Atorg. apache. jasper. servlet. JspServlet. service (JspServlet. java: 334)

Atjavax. servlet. http. HttpServlet. service (HttpServlet. java: 727)

Atorg. apache. catalina. core. ApplicationFilterChain. internalDoFilter (ApplicationFilterChain. java: 303)

Atorg. apache. catalina. core. ApplicationFilterChain. doFilter (ApplicationFilterChain. java: 208)

Atorg. apache. catalina. core. ApplicationDispatcher. invoke (ApplicationDispatcher. java: 748)

Atorg. apache. catalina. core. ApplicationDispatcher. processRequest (ApplicationDispatcher. java: 486)

Atorg. apache. catalina. core. ApplicationDispatcher. doForward (ApplicationDispatcher. java: 411)

Atorg. apache. catalina. core. ApplicationDispatcher. forward (ApplicationDispatcher. java: 338)

At

......

The code is written as follows:

<C: iftest = "$ {! Command. new} ">

<INPUTtype = "submit" name = "delete" value = "Delete" style = "margin-right: 5px; font-size: 8pt; font-family: Arial; width: 70px"

Onclick = "returnconfirm ('Are you sure you want to delete this repository? ') "/>

</C: if>


In the final solution, add the following to the configuration file catalina. properties of tomcat:

Org. apache. el. parser. SKIP_IDENTIFIER_CHECK = true

Cause analysis:

Problems caused by Tomcat 7

1. struts tag validation is more rigorous. If the struts tag contains nested double quotation marks, an error is returned.

2. The EL expression verification is more rigorous. After the tomcat version is upgraded, the previous Code may be unavailable.

3. The security level is relatively high by default. For example, the applet cannot access the request.

The specific phenomenon may be:

1. Error Attribute value is quoted with "which must be escaped when used withinthe value

2. containsinvalid expression (s): javax. el. ELException: [do] is not a valid Javaidentifier

Atorg. apache. jasper. compiler. DefaultErrorHandler. jspError (DefaultErrorHandler. java: 40)

3. request = null

Solution:

$ CATALINA_BASE/conf/catalina. properties added

Org. apache. jasper. compiler. Parser. STRICT_QUOTE_ESCAPING = false

Org. apache. el. parser. SKIP_IDENTIFIER_CHECK = true

$ CATALINA_BASE/conf/Catalina/localhost/webapp. xml added

<Context path = "" docBase = "/vmind" useHttpOnly = "false" debug = "0" reloadable = "false">

Or modify the context option of server. xml and add useHttpOnly = "false.

Second question:

The tomcat folder contains spaces. When you use the class loader to obtain the path, the space is converted to 20%.

Today, I encountered a problem. When the tomcat folder contains spaces, the space will be converted to 20% when the class loader gets the path ..

Solution: encode the path with a URL;

Eg:

String path = CustFactory. class. getClassLoader (). getResource ("config. properties"). getPath (); changed

String path = CustFactory. class. getClassLoader (). getResource ("config. properties"). toURI (). getPath ();

Third question

Copy it to the server.TomcatIt is always unable to start, and the final reason is the configurationThe CATALINA_HOME environment variable causesTomcatAll are in the environment variable configuration path.Tomcat.

Set the CATALINA_HOME environment variable

Set the CATALINA_HOME environment variable

1. CATALINA_HOME is the alias of the TOMCAT installation path to facilitate the use of TOMCAT

2. Computer> Properties> environment variables: Create an environment variable. The variable name is CATALINA_HOME, and the variable value is the decompressed directory of tomcat. on my computer, the variable name is "F: \ apache-tomcat-7.0.12". Note that you do not need to add "\" or ";".

3. In the environment variable Path, add "TALINA_HOME % \ bin \"

4. start tomcat: Enter command line cmd and enter startup. bat

5. Open your browser and enter http: // localhost: 8080 to check whether tomcat is started normally.

6. Close tomcat: Enter command line cmd and enter shutdown. bat





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.