启动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 相关文章推荐
源码解读Spring-Integration执行过程
Jun 11 Java/Android
解决SpringCloud Feign传对象参数调用失败的问题
Jun 23 Java/Android
自从在 IDEA 中用了热部署神器 JRebel 之后,开发效率提升了 10(真棒)
Jun 26 Java/Android
Java常用函数式接口总结
Jun 29 Java/Android
Spring Cloud Gateway去掉url前缀
Jul 15 Java/Android
gateway与spring-boot-starter-web冲突问题的解决
Jul 16 Java/Android
java设计模式--建造者模式详解
Jul 21 Java/Android
Android自定义scrollview实现回弹效果
Apr 01 Java/Android
Java工作中实用的代码优化技巧分享
Apr 21 Java/Android
Java数据结构之堆(优先队列)
May 20 Java/Android
Java时间工具类Date的常用处理方法
May 25 Java/Android
tree shaking对打包体积优化及作用
Jul 07 Java/Android
详解java如何集成swagger组件
SpringCloud Alibaba项目实战之nacos-server服务搭建过程
java中重写父类方法加不加@Override详解
Jun 21 #Java/Android
Java并发编程之Executor接口的使用
深入理解以DEBUG方式线程的底层运行原理
浅谈什么是SpringBoot异常处理自动配置的原理
SpringAop日志找不到方法的处理
You might like
在“咖啡之国”感受咖啡文化
2021/03/03 咖啡文化
PHP 图像尺寸调整代码
2010/05/26 PHP
深入extjs与php参数交互的详解
2013/06/25 PHP
CI框架中site_url()和base_url()的区别
2015/01/07 PHP
php随机显示指定文件夹下图片的方法
2015/07/13 PHP
Linux系统中设置多版本PHP共存配合Nginx服务器使用
2015/12/21 PHP
PHP实现合并两个排序链表的方法
2018/01/19 PHP
解决遍历时Array.indexOf产生的性能问题
2012/07/03 Javascript
jquery实现控制表格行高亮实例
2013/06/05 Javascript
jquery+json实现数据列表分页示例代码
2013/11/15 Javascript
jQuery+PHP实现动态数字展示特效
2015/03/14 Javascript
用JavaScript判断CSS浏览器类型前缀的两种方法
2015/10/08 Javascript
javascript如何实现暂停功能
2015/11/06 Javascript
超详细的javascript数组方法汇总
2015/11/21 Javascript
基于JavaScript实现全选、不选和反选效果
2017/02/15 Javascript
Node.js Buffer用法解读
2018/05/18 Javascript
对angularJs中ng-style动态改变样式的实例讲解
2018/09/30 Javascript
微信小程序导入Vant报错VM292:1 thirdScriptError的解决方法
2019/08/01 Javascript
解决ant Design中this.props.form.validateFields未执行的问题
2020/10/27 Javascript
微信小程序实现音乐播放页面布局
2020/12/11 Javascript
[48:21]林俊杰圣堂刺客超神杀戮秀
2014/10/29 DOTA
python sort、sorted高级排序技巧
2014/11/21 Python
用python制作游戏外挂
2018/01/04 Python
Python闭包之返回函数的函数用法示例
2018/01/27 Python
python实现多线程网页下载器
2018/04/15 Python
PyQt5每天必学之进度条效果
2018/04/19 Python
Python Celery多队列配置代码实例
2019/11/22 Python
Python模块_PyLibTiff读取tif文件的实例
2020/01/13 Python
Pandas中DataFrame基本函数整理(小结)
2020/07/20 Python
Matplotlib配色之Colormap详解
2021/01/05 Python
大学生简历的个人自我评价
2013/12/04 职场文书
编辑找工作求职信范文
2013/12/16 职场文书
工业设计专业自荐书
2014/06/05 职场文书
致百米运动员广播稿5篇
2014/10/13 职场文书
道歉的话怎么说
2015/05/12 职场文书
2016年小学优秀班主任事迹材料
2016/02/29 职场文书