Tomcat Notes: Common Issues Of Tomcat

This is a personal study notes of Apache Tomcat. Below are main reference material.

- YouTube Apache Tomcat Full Tutorial,owed by Alpha Brains Courses. https://www.youtube.com/watch?v=rElJIPRw5iM&t=801s



  • 1、Overview
  • 2、Trouble shooting
    • 2.1、Bad Config file
      • 2.1.1、What is It
      • 2.1.2、How To Troubleshooting
    • 2.2、JSP Problems
      • 2.2.1、What Is It
      • 2.2.2、Why Important


1、Overview

This article is about common issues of Tomcat and how to solve them.

2、Trouble shooting

The errors we talk about in here is that occur between the web app and the web container, Catalina.

The errors in app logic is not covered in this article.

There are 3 types of errors in broad categories and each one of them features differently, making it easier for us to narrow focus.

2.1、Bad Config file

2.1.1、What is It

For those config file. the standard deployment descriptor web.xmlfor example, If they can’t be parsed properly by tomcat they are so called bad config files.

Here are common reasons

  • The XML is syntactically ill-formed (i.e., lack of a end tag)
  • The XML doesn’t match a required schema (i.e. can’t pass a ‘validating parse’).

2.1.2、How To Troubleshooting

When deploying with a .warfile rather than a unpacked folder, if it goes well Tomcat will generate an unpacked version of the .warfile.

Thus if there is no unpacked file, the most possible case is that you have at least 1 bad config file.

It’s time to check config files one by one.



2.2、JSP Problems

2.2.1、What Is It

If your .warfile include some JSP file they will eventually be translated into servlets by Jasper so that browsers can understand.

But Java syntax errors could occur when compiling, such as the following line lacking of a semicolon.

System.out.print("Hello World")     // ';' expected

Here is the content of a JSP file with JSP problem.

<!doctype>
<html><body><!-- Below is a 'scriplet': Java code embedded in an HTML template.The code contains errors, which will prevent deployment.--><%out.println("Hello World");  //### Error: missing semicolon in statement%></body>
</html>

So errors ,coming from Java code which is included by JSP file and result in failing to compile, is called JSP problem.


2.2.2、Why Important

By default, JSP doesn’t be translated into servlets until the first client hit Tomcat, which means that we deploy an application with errors that should be discovered when compiling project.

We should turn on a switch in web.xml, translating all JSP into servlets when deploying or before deploying so that we can find potential errors as soon as possible.

And there’re many ways to precompile JSP files. For example, if your project use maven to build, then precompile JSP with maven plugin jspc-maven-pluginis a proper solution.



本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/622718.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

远程登陆利器 ssh

文章目录 远程登陆利器 ssh登陆远程服务器指定用户名多数情况的登陆方式查看服务器的时间指定端口更多信息 远程登陆利器 ssh ssh命令是openssh套件中的客户端连接工具&#xff0c;使用加密协议实现安全的远程登录服务器&#xff0c;实现对服务器的远程管理。 官方定义为&…

ZZULIOJ 1110: 最近共同祖先(函数专题)

题目描述 如上图所示&#xff0c;由正整数1, 2, 3, ...组成了一棵无限大的二叉树。从某一个结点到根结 点&#xff08;编号是1 的结点&#xff09;都有一条唯一的路径&#xff0c;比如从10 到根结点的路径是(10, 5, 2, 1)&#xff0c; 从4 到根结点的路径是(4, 2, 1)&#xff0…

网络地图服务(WMS)详解

文章目录 1.概述2.GetCapabilities3.GetMap4.GetFeatureInfo 阅读本文之前可参考前文&#xff1a;《地图服务器GeoServer的安装与配置》与《GeoServer发布地图服务&#xff08;WMS、WFS&#xff09;》。 1.概述 经过前文的介绍&#xff0c;相信我们对WMS/WFS服务已经有了一个非…

Modbus协议学习第二篇之Modbus poll slave仿真软件初体验

软件准备 学习Modbus离不开硬件&#xff0c;好在我们可以通过仿真软件来模拟硬件&#xff0c;本篇博客就来简单介绍一下Modbus仿真软件的最基础使用方法&#xff0c;需要用到的3款仿真软件如下&#xff1a; Modbus Poll 64位 / Modbus Poll 32位&#xff08;根据自己机器位数选…

C++——map和set的基本使用

目录 一&#xff0c;关联式容器 二&#xff0c;键值对 三&#xff0c;set的使用 3.1 set介绍 3.2 set的插入和删除 3.3 set的pair 3.4 multiset 四&#xff0c;map的使用 4.1 map介绍 4.2 map实现简易字典 4.3 map实现统计次数 4.4 map的[] 五&#xff0c;使用map或…

LV.13 D11 Linux驱动移植及内核深化 学习笔记

一、设备树 1.1 设备树 设备树是一种描述硬件信息的数据结构&#xff0c;Linux内核运行时可以通过设备树将硬件信息直接传递给Linux内核&#xff0c;而不再需要在Linux内核中包含大量的冗余编码 举例&#xff1a;让LED2闪烁的代码中&#xff0c;有逻辑代码和设备代码。Li…

案例121:基于微信小程序的作品集展示系统设计与实现

文末获取源码 开发语言&#xff1a;Java 框架&#xff1a;SSM JDK版本&#xff1a;JDK1.8 数据库&#xff1a;mysql 5.7 开发软件&#xff1a;eclipse/myeclipse/idea Maven包&#xff1a;Maven3.5.4 小程序框架&#xff1a;uniapp 小程序开发软件&#xff1a;HBuilder X 小程序…

【模型评估 04】A/B测试的陷阱

互联网公司中&#xff0c;A/B测试是验证新模块、新功能、新产品是否有效&#xff1b;新算法、新模型的效果是否有提升&#xff1b;新设计是否受到用户欢迎&#xff1b;新更改是否影响用户体验的主要测试方法。在机器学习领域中&#xff0c;A/B测试是验证模型最终效果的主要手段…

Ransac随机采样一致性拟合——圆柱

目录 一、RANSAC拟合方法原理 二、PCL圆柱拟合模型 三、实现代码 四、实现结果

C语言 - 最简单,最易懂的指针、引用讲解

一、变量、地址、变量值 二、直接上代码&#xff0c;一边看上图&#xff0c;一边讲解 #include <stdio.h>struct Hello {int a;int b; };int main() {struct Hello h;h.a 10;h.b 20;struct Hello *hp;hp &h;printf("1: h的地址是%d&#xff0c;hp地址是%d \…

stm32学习笔记:USART串口通信

1、串口通信协议&#xff08;简介软硬件规则&#xff09; 全双工&#xff1a;打电话。半双工&#xff1a;对讲机。单工&#xff1a;广播 时钟&#xff1a;I2C和SPI有单独的时钟线&#xff0c;所以它们是同步的&#xff0c;接收方可以在时钟信号的指引下进行采样。串口、CAN和…

docker完成redis 三主三从

文章目录 关闭防火墙启动docker后台服务新建6个docker容器redis实例创建并运行docker容器实例 进入容器redis-node-1并为6台机器构建集群关系链接进入6381作为切入点&#xff0c;查看集群状态主从容错切换迁移案例容错切换迁移 主从扩容案例为主节点6387分配从节点6388主从缩容…

一、MOJO环境部署和安装

以Ubuntu系统为例。 安装mojo-CLI curl https://get.modular.com | MODULAR_AUTHmut_fe303dc5ca504bc4867a1db20d897fd8 sh - 安装mojo SDK modular auth mojo modular auth install mojo 查看mojo版本号 mojo --version 输入mojo指令&#xff0c;进入交互编程窗口

On the Robustness of Backdoor-based Watermarkingin Deep Neural Networks

关于深度神经网络中基于后门的数字水印的鲁棒性 ABSTRACT 在过去的几年中&#xff0c;数字水印算法已被引入&#xff0c;用于保护深度学习模型免受未经授权的重新分发。我们调查了最新深度神经网络水印方案的鲁棒性和可靠性。我们专注于基于后门的水印技术&#xff0c;并提出了…

6、C语言:输入与输出

输入输出 标准输入输出getchar&putchar函数printf函数sprintf函数格式化输入——scanf函数 文件访问文件读写 错误处理&#xff1a;stderr和exit行输入和行输出常用函数字符串操作函数字符类别测试和转换函数存储管理函数数学函数随机数发生器函数其他 标准输入输出 getch…

2024年【氧化工艺】免费试题及氧化工艺作业模拟考试

题库来源&#xff1a;安全生产模拟考试一点通公众号小程序 氧化工艺免费试题根据新氧化工艺考试大纲要求&#xff0c;安全生产模拟考试一点通将氧化工艺模拟考试试题进行汇编&#xff0c;组成一套氧化工艺全真模拟考试试题&#xff0c;学员可通过氧化工艺作业模拟考试全真模拟…

洛谷 P1439 【模板】最长公共子序列【线性dp+dp模型转换】

原题链接&#xff1a;https://www.luogu.com.cn/problem/P1439 题目描述 给出 1,2,…,n 的两个排列 P1​ 和 P2​ &#xff0c;求它们的最长公共子序列。 输入格式 第一行是一个数 n。 接下来两行&#xff0c;每行为 n 个数&#xff0c;为自然数 1,2,…,n 的一个排列。 输…

2023 年全国职业院校技能大赛(高职组) “云计算应用”赛项赛卷 B部分解析

2022 年全国职业院校技能大赛高职组云计算赛项试卷部分解析 【赛程名称】第一场&#xff1a;模块一 私有云、模块二 容器云【任务 1】私有云服务搭建[5 分]【题目 1】1.1.1 基础环境配置[0.2 分]【题目 2】1.1.2 Yum 源配置[0.2 分]【题目 3】1.1.3 配置无秘钥 ssh[0.2 分]【题…

Keil5如何生成反汇编文件

Keil5如何生成反汇编文件 在Keil5界面下点击选项&#xff0c;选择“User”&#xff0c;勾选“After Build/Rebuild”中“RUN #1”&#xff0c;复制fromelf --text -a -c --outputxxx.dis xxx.axf 在Linker栏中找到“Linker Control string”里最后-o后的.axf文件&#xff0c;将…

Linux:nginx设置网站https

http和https的区别 http: 80 https: 443 这种协议比http协议要安全&#xff0c;因为传输数据是经过加密的 HTTPS简介 HTTPS其实是有两部分组成&#xff1a;HTTP SSL / TLS&#xff0c;也就是在HTTP上又加了一层处理加密信息的模块。服务端和客户端的信息传输都会通过…