启动Tomcat时出现大量乱码的解决方法
程序员文章站
2022-03-10 14:16:43
启动tomcat乱码1. 在 tomcat 的启动窗口打印的启动信息中包含了大量的中文乱码,虽然这些对 tomcat 本身的使用没有任何影响,但却非常碍眼,影响视觉效果!d:\jar\apache-t...
启动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 淇℃伅: 浣跨敤apr鐗堟湰[1.7.0]鍔犺浇浜嗗熀浜嶢pr鐨凙pache tomcat鏈満搴揫1.2.28]銆� 鍏湀 15, 2021 12:06:59 涓婂崍 org.apache.catalina.core.aprlifecyclelistener lifecycleevent 淇℃伅: apr鍔熻兘锛欼pv6[true]銆乻endfile[true]銆乤ccept filters[false]銆乺andom[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 淇℃伅: 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰� [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乱码内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
推荐阅读
-
Python遍历zip文件输出名称时出现乱码问题的解决方法
-
电脑显示U盘快捷方式打开提示"启动_WEDJHTDMM.nil时出现问题"的故障原因及解决方法
-
启动Tomcat时出现大量乱码的解决方法
-
php向页面输出中文时出现乱码的解决方法
-
JSP MySQL插入数据时出现中文乱码问题的解决方法
-
安装oracle 11g时,报启动服务出现错误,找不到OracleMTSRecoveryService的解决方法
-
apache-tomcat-7.0.94在Windows上启动时,控制台黑窗口出现乱码解决
-
电脑开机启动时出现DHCP自检的完美解决方法(三种方法)
-
Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
-
会声会影启动时出现错误1和错误38问题的解决方法