启动Tomcat时出现大量乱码的解决方法


Posted in Java/Android onJune 21, 2021

启动Tomcat乱码

1. 在 tomcat 的启动窗口打印的启动信息中包含了大量的中文乱码,虽然这些对 tomcat 本身的使用没有任何影响,但却非常碍眼,影响视觉效果!

D:\jar\apache-tomcat-7.0.109\bin\catalina.bat run
[2021-06-15 12:06:55,652] Artifact ch01hellospringmvc:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Users\lenovo\.IntelliJIdea2018.3\system\tomcat\Tomcat_7_0_109_springmvc"
Using CATALINA_HOME:   "D:\jar\apache-tomcat-7.0.109"
Using CATALINA_TMPDIR: "D:\jar\apache-tomcat-7.0.109\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_40"
Using CLASSPATH:       "D:\jar\apache-tomcat-7.0.109\bin\bootstrap.jar;D:\jar\apache-tomcat-7.0.109\bin\tomcat-juli.jar"
Using CATALINA_OPTS:   ""
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? Server.???″?ㄧ???�: Apache Tomcat/7.0.109
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ???″?ㄦ??寤�:        Apr 22 2021 18:43:38 UTC
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ???″?ㄧ??????      7.0.109.0
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ??浣?绯荤???绉?      Windows 8.1
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? OS.????           6.3
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?舵??:              amd64
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? Java ???????:     C:\Program Files\Java\jdk1.8.0_40\jre
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? Java?????虹???�:    1.8.0_40-b25
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? JVM.渚?搴??�:        Oracle Corporation
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? CATALINA_BASE:     C:\Users\lenovo\.IntelliJIdea2018.3\system\tomcat\Tomcat_7_0_109_springmvc
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? CATALINA_HOME:     D:\jar\apache-tomcat-7.0.109
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Djava.util.logging.config.file=C:\Users\lenovo\.IntelliJIdea2018.3\system\tomcat\Tomcat_7_0_109_springmvc\conf\logging.properties
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dcom.sun.management.jmxremote=
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dcom.sun.management.jmxremote.port=1099
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dcom.sun.management.jmxremote.ssl=false
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dcom.sun.management.jmxremote.password.file=C:\Users\lenovo\.IntelliJIdea2018.3\system\tomcat\Tomcat_7_0_109_springmvc\jmxremote.password
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dcom.sun.management.jmxremote.access.file=C:\Users\lenovo\.IntelliJIdea2018.3\system\tomcat\Tomcat_7_0_109_springmvc\jmxremote.access
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Djava.rmi.server.hostname=127.0.0.1
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Djdk.tls.ephemeralDHKeySize=2048
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dignore.endorsed.dirs=
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dcatalina.base=C:\Users\lenovo\.IntelliJIdea2018.3\system\tomcat\Tomcat_7_0_109_springmvc
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Dcatalina.home=D:\jar\apache-tomcat-7.0.109
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.VersionLoggerListener log
淇℃?? ?戒护琛????帮?       -Djava.io.tmpdir=D:\jar\apache-tomcat-7.0.109\temp
???? 15, 2021 12:06:59 涓??? org.apache.catalina.core.AprLifecycleListener lifecycleEvent
淇℃?? 浣跨??PR????1.7.0]??杞戒??轰?APR??Apache Tomcat???哄?[1.2.28]?�
???? 15, 2021 12:06:59 涓??? org.apache.catalina.core.AprLifecycleListener lifecycleEvent
淇℃?? APR???斤?IPv6[true]??sendfile[true]??accept filters[false]??random[true]?�
???? 15, 2021 12:06:59 涓??? org.apache.catalina.core.AprLifecycleListener initializeSSL
淇℃?? OpenSSL??????濮??� [OpenSSL 1.1.1k  25 Mar 2021]
???? 15, 2021 12:06:59 涓??? org.apache.coyote.AbstractProtocol init
淇℃?? ??濮?????璁????? ["http-apr-8090"]
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.Catalina load
淇℃?? Initialization processed in 1462 ms
???? 15, 2021 12:06:59 涓??? org.apache.catalina.core.StandardService startInternal
淇℃?? 姝e?ㄥ???ㄦ????Catalina]
???? 15, 2021 12:06:59 涓??? org.apache.catalina.core.StandardEngine startInternal
淇℃?? Starting Servlet Engine: Apache Tomcat/7.0.109
???? 15, 2021 12:06:59 涓??? org.apache.coyote.AbstractProtocol start
淇℃?? 寮�濮???璁?????ユ??["http-apr-8090"]
???? 15, 2021 12:06:59 涓??? org.apache.catalina.startup.Catalina start
淇℃?? Server startup in 108 ms
Connected to server
[2021-06-15 12:07:00,087] Artifact ch01hellospringmvc:war exploded: Artifact is being deployed, please wait...
???? 15, 2021 12:07:00 涓??? org.apache.catalina.deploy.WebXml setVersion
璀﹀??: Unknown version string [4.0]. Default version will be used.
???? 15, 2021 12:07:02 涓??? org.apache.catalina.startup.TldConfig execute
淇℃?? At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[2021-06-15 12:07:03,217] Artifact ch01hellospringmvc:war exploded: Artifact is deployed successfully
[2021-06-15 12:07:03,218] Artifact ch01hellospringmvc:war exploded: Deploy took 3,131 milliseconds
???? 15, 2021 12:07:09 涓??? org.apache.catalina.startup.HostConfig deployDirectory
淇℃?? ??web 搴??ㄧ?搴??ㄧ讲?扮???#65533; [D:\jar\apache-tomcat-7.0.109\webapps\manager]
???? 15, 2021 12:07:10 涓??? org.apache.catalina.startup.HostConfig deployDirectory
淇℃?? Web搴??ㄧ?搴????[D:\jar\apache-tomcat-7.0.109\webapps\manager]???ㄧ讲宸插??319]姣????瀹??�

2. 对于乱码问题,原因是字节流解码为字符串时,使用了错误的字符集(和编码所用字符集不一致) !

我们找到 tomcat 目录下的 config 子目录中,找到"logging.properties" 文件,打开这个文本文件,找到如下配置项:

java.util.logging.ConsoleHandler.encoding = UTF-8

将 UTF-8 修改为 GBK,修改后的效果为:

java.util.logging.ConsoleHandler.encoding = GBK

保存后,重启 tomcat

启动Tomcat时出现大量乱码的解决方法

启动Tomcat时出现大量乱码的解决方法

最后,重启窗口,乱码问题就解决了

启动Tomcat时出现大量乱码的解决方法

到此这篇关于启动Tomcat时出现大量乱码的解决方法的文章就介绍到这了,更多相关启动Tomcat乱码内容请搜索三水点靠木以前的文章或继续浏览下面的相关文章希望大家以后多多支持三水点靠木!

Java/Android 相关文章推荐
Java常用工具类汇总 附示例代码
Jun 26 Java/Android
Java elasticsearch安装以及部署教程
Jun 28 Java/Android
Springboot配置suffix指定mvc视图的后缀方法
Jul 03 Java/Android
用Java实现简单计算器功能
Jul 21 Java/Android
关于springboot 配置date字段返回时间戳的问题
Jul 25 Java/Android
简述Java中throw-throws异常抛出
Aug 07 Java/Android
Java字符串逆序方法详情
Mar 21 Java/Android
Java 数据结构七大排序使用分析
Apr 02 Java/Android
springboot应用服务启动事件的监听实现
Apr 06 Java/Android
零基础学java之带参数以及返回值的方法
Apr 10 Java/Android
Android开发之底部导航栏的快速实现
Apr 28 Java/Android
Spring Boot 实现 WebSocket
Apr 30 Java/Android
详解java如何集成swagger组件
SpringCloud Alibaba项目实战之nacos-server服务搭建过程
java中重写父类方法加不加@Override详解
Jun 21 #Java/Android
Java并发编程之Executor接口的使用
深入理解以DEBUG方式线程的底层运行原理
浅谈什么是SpringBoot异常处理自动配置的原理
SpringAop日志找不到方法的处理
You might like
如何把PHP转成EXE文件
2006/10/09 PHP
php 读取shell管道传输过来的内容
2010/03/01 PHP
浅析PKI加密解密 OpenSSL
2013/07/01 PHP
PHP $O00OO0=urldecode & eval 解密,记一次商业源码的去后门
2020/09/13 PHP
通过AJAX的JS、JQuery两种方式解析XML示例介绍
2013/09/23 Javascript
js实现可得到不同颜色值的颜色选择器实例
2015/02/28 Javascript
基于Javascript实现的不重复ID的生成器
2016/12/25 Javascript
JS获得一个对象的所有属性和方法实例
2017/02/21 Javascript
javascript 组合按键事件监听实现代码
2017/02/21 Javascript
Bootstrap.css与layDate日期选择样式起冲突的解决办法
2017/04/07 Javascript
详解Vue文档中几个易忽视部分的剖析
2018/03/24 Javascript
通过vue提供的keep-alive减少对服务器的请求次数
2018/04/01 Javascript
JS插件clipboard.js实现一键复制粘贴功能
2020/12/04 Javascript
vue中的自定义分页插件组件的示例
2018/08/18 Javascript
利用Angular2的Observables实现交互控制的方法
2018/12/27 Javascript
vue.js的双向数据绑定Object.defineProperty方法的神奇之处
2019/01/18 Javascript
通过JQuery,JQueryUI和Jsplumb实现拖拽模块
2019/06/18 jQuery
JavaScript 装逼指南(js另类写法)
2020/05/10 Javascript
Python使用struct处理二进制的实例详解
2017/09/11 Python
Python Nose框架编写测试用例方法
2017/10/26 Python
python+tkinter编写电脑桌面放大镜程序实例代码
2018/01/16 Python
OpenCV中VideoCapture类的使用详解
2020/02/14 Python
python的sys.path模块路径添加方式
2020/03/09 Python
Python restful框架接口开发实现
2020/04/13 Python
加拿大领先的时尚和体育零售商:Sporting Life
2019/12/15 全球购物
意大利包包和行李箱销售网站:Bagaglio.it
2021/03/02 全球购物
是否有自动比较结构的方法
2015/06/03 面试题
汽车工程专业应届生求职信
2013/10/19 职场文书
公安交警中队队长个人对照检查材料思想汇报
2014/10/05 职场文书
2014年仓库保管员工作总结
2014/12/03 职场文书
本溪关门山导游词
2015/02/09 职场文书
党员带头倡议书
2015/04/29 职场文书
2016北大自主招生自荐信模板
2016/01/28 职场文书
小学四年级作文之最感动的一件事
2019/11/01 职场文书
python opencv人脸识别考勤系统的完整源码
2021/04/26 Python
彻底理解golang中什么是nil
2021/04/29 Golang