启动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中多线程下载图片并压缩能提高效率吗
Jul 01 Java/Android
Java8中Stream的一些神操作
Nov 02 Java/Android
Java异常处理try catch的基本用法
Dec 06 Java/Android
JavaCV实现照片马赛克效果
Jan 22 Java/Android
JVM之方法返回地址详解
Feb 28 Java/Android
spring注解 @PropertySource配置数据源全流程
Mar 25 Java/Android
Android自定义scrollview实现回弹效果
Apr 01 Java/Android
Android中View.post和Handler.post的关系
Jun 05 Java/Android
Android Gradle 插件自定义Plugin实现注意事项
Jun 16 Java/Android
AndroidStudio图片压缩工具ImgCompressPlugin使用实例
Aug 05 Java/Android
Mybatis 一级缓存和二级缓存原理区别
Sep 23 Java/Android
详解java如何集成swagger组件
SpringCloud Alibaba项目实战之nacos-server服务搭建过程
java中重写父类方法加不加@Override详解
Jun 21 #Java/Android
Java并发编程之Executor接口的使用
深入理解以DEBUG方式线程的底层运行原理
浅谈什么是SpringBoot异常处理自动配置的原理
SpringAop日志找不到方法的处理
You might like
目录,文件操作详谈―PHP
2006/11/25 PHP
PHP 字符串正则替换函数preg_replace使用说明
2011/07/15 PHP
PHP PDOStatement::rowCount讲解
2019/02/01 PHP
JavaScript常用全局属性与方法记录积累
2013/07/03 Javascript
JS可以控制样式的名称写法一览
2014/01/16 Javascript
Javascript异步编程模型Promise模式详细介绍
2014/05/08 Javascript
js实现页面跳转重定向的几种方式
2014/05/29 Javascript
jQuery插件EasyUI获取当前Tab中iframe窗体对象的方法
2016/08/05 Javascript
js 能实现监听F5页面刷新子iframe 而父页面不刷新的方法
2016/11/09 Javascript
微信开发 JS-SDK 6.0.2 经常遇到问题总结
2016/12/08 Javascript
微信小程序 wx.uploadFile在安卓手机上面the same task is working问题解决
2016/12/14 Javascript
jQuery中的siblings()是什么意思(推荐)
2016/12/29 Javascript
jQuery鼠标移动图片上实现放大效果
2017/06/25 jQuery
Vue结合SignalR实现前后端实时消息同步
2017/09/19 Javascript
JS中的JSON对象的定义和取值实现代码
2018/05/09 Javascript
Vue.js watch监视属性知识点总结
2019/11/11 Javascript
详解Nuxt.js 实战集锦
2019/11/19 Javascript
Node.js API详解之 util模块用法实例分析
2020/05/09 Javascript
微信小程序点击生成朋友圈分享图(遇到的坑)
2020/06/17 Javascript
使用Python实现博客上进行自动翻页
2017/08/23 Python
python numpy格式化打印的实例
2018/05/14 Python
详解Python装饰器
2019/03/25 Python
Python实用工具FuckIt.py介绍
2019/07/02 Python
Python如何通过Flask-Mail发送电子邮件
2020/01/29 Python
pytorch数据预处理错误的解决
2020/02/20 Python
python和php哪个容易学
2020/06/19 Python
浅析Python 中的 WSGI 接口和 WSGI 服务的运行
2020/12/09 Python
红色连衣裙精品店:Red Dress Boutique
2018/08/11 全球购物
G-Form护具官方网站:美国运动保护装备
2019/09/04 全球购物
指针和引用有什么区别
2013/01/13 面试题
如何在存储过程中使用Loop
2016/01/05 面试题
教师自我评价范例
2013/09/24 职场文书
总经理岗位职责描述
2014/02/08 职场文书
铁路安全事故反思
2014/04/26 职场文书
婚庆公司计划书
2014/09/15 职场文书
2014年乡镇团委工作总结
2014/12/18 职场文书