首页 > 编程语言 >tomcat9 启动时报错:java.lang.IllegalStateException: Malformed \uxxxx encoding的解决

tomcat9 启动时报错:java.lang.IllegalStateException: Malformed \uxxxx encoding的解决

时间:2024-06-18 15:03:36浏览次数:24  
标签:lang uxxxx catalina java boot springframework apache org

1、启动tomcat9 spring boot项目的时候,直接报下面的错误。

2024-06-18 09:38:20 Apache Commons Daemon procrun stdout initialized.
09:38:35.597 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Malformed \uxxxx encoding.
	at org.springframework.boot.env.OriginTrackedPropertiesLoader$CharacterReader.readUnicode(OriginTrackedPropertiesLoader.java:288)
	at org.springframework.boot.env.OriginTrackedPropertiesLoader$CharacterReader.readEscaped(OriginTrackedPropertiesLoader.java:270)
	at org.springframework.boot.env.OriginTrackedPropertiesLoader$CharacterReader.read(OriginTrackedPropertiesLoader.java:229)
	at org.springframework.boot.env.OriginTrackedPropertiesLoader$CharacterReader.read(OriginTrackedPropertiesLoader.java:212)
	at org.springframework.boot.env.OriginTrackedPropertiesLoader.loadValue(OriginTrackedPropertiesLoader.java:157)
	at org.springframework.boot.env.OriginTrackedPropertiesLoader.loadKeyAndValue(OriginTrackedPropertiesLoader.java:125)
	at org.springframework.boot.env.OriginTrackedPropertiesLoader.load(OriginTrackedPropertiesLoader.java:98)
	at org.springframework.boot.env.OriginTrackedPropertiesLoader.load(OriginTrackedPropertiesLoader.java:65)
	at org.springframework.boot.env.PropertiesPropertySourceLoader.loadProperties(PropertiesPropertySourceLoader.java:70)
	at org.springframework.boot.env.PropertiesPropertySourceLoader.load(PropertiesPropertySourceLoader.java:49)
	at org.springframework.boot.context.config.StandardConfigDataLoader.load(StandardConfigDataLoader.java:54)
	at org.springframework.boot.context.config.StandardConfigDataLoader.load(StandardConfigDataLoader.java:36)
	at org.springframework.boot.context.config.ConfigDataLoaders.load(ConfigDataLoaders.java:107)
	at org.springframework.boot.context.config.ConfigDataImporter.load(ConfigDataImporter.java:128)
	at org.springframework.boot.context.config.ConfigDataImporter.resolveAndLoad(ConfigDataImporter.java:86)
	at org.springframework.boot.context.config.ConfigDataEnvironmentContributors.withProcessedImports(ConfigDataEnvironmentContributors.java:121)
	at org.springframework.boot.context.config.ConfigDataEnvironment.processWithProfiles(ConfigDataEnvironment.java:311)
	at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:232)
	at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:102)
	at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:94)
	at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102)
	at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)
	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:175)
	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:155)
	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:97)
	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1185)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1933)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:477)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)

这个encoding这个是字符集的问题,一开始的路径是:d:/xx/xxxx的路径,这样是正常的。

然后直接从地址栏中直接拷贝,变成了下面的:

F:\Tomcat9\webapps\xxx

上面的错误是windows下面转义符导致。

然后访问对应接口的时候,直接报404的错误。

2、application-dev.properties的设置如下,综合以上,有二种解决方法:

1)file.uploadFolder=F:\\Tomcat9\\webapps\\xxx

2)  file.uploadFolder=F:/Tomcat9/webapps/xxx

这二种设置都行。

标签:lang,uxxxx,catalina,java,boot,springframework,apache,org
From: https://blog.csdn.net/jwbabc/article/details/139765217

相关文章

  • Golang语言基础超详细教程&备忘录
    作者的话:这篇文章是之前刚从Java转到Go,学习时编写的,力求全面且详细。本文是基础内容,适合初学者,也适合老手用来当备忘录。和网上其他文档不同的是,我陆陆续续将很多小的知识点也补进来了,后续也会继续补充。这篇文章开始是我写在本机,然后又改写到自己的个人博客,现在有誊写到CSDN,......
  • Java项目:springboot优咪商城(计算机毕业设计)
    作者主页:Java毕设网 简介:Java领域优质创作者、Java项目、学习资料、技术互助文末获取源码一、项目介绍优咪网上购物体验系统1.该平台主要有两大功能:(1)浏览平台官方和认证作者提供的篮球相关信息,信息类型包括:视频,新闻,评论类文章,比赛结果(2)篮球周边商城,商品分类球......
  • Javaweb实现简易记事簿 jdbc实现Java连接数据库
    //注册-[]获取register的数据,从表单传过来将(账户,密码,用户名)上面的数据写入数据库中,用jdbc(插入)加载数据库驱动,连接数据库,发送SQL加载数据库有可能失败保险起见抛一个异常返回判断,如果注册成功则提醒用户注册成功,并且跳转到登录页面进行登录。如果注册失败则提醒用户注册失败,......
  • java之sql注入代码审计
    java之sql注入代码审计前言其实找到漏洞原因很简单,主要想学习一下JDBCsql的过程JDBC简单介绍Java通过java.sql.DriverManager来管理所有数据库的驱动注册,所以如果想要建立数据库连接需要先在java.sql.DriverManager中注册对应的驱动类,然后调用getConnection方法才能连接上数......
  • 基于Java+SpringBoot+Vue+elementUI的学生宿舍管理平台的设计与开发
    第一章绪论1.1选题背景和意义1.2国内外学生宿舍管理平台现状第二章相关技术简介2.1开发工具介绍2.1.1IDEA2.1.2VSCode2.1.3Navicat2.1.4宝塔面板2.2关键技术介绍2.2.1Java2.2.2SpringBoot2.2.3Mybatis2.2.4Vue2.2.5MySQL2.2.6Redis2.2.7E......
  • javascript-obfuscator混淆
    安装npminstalljavascript-obfuscator-g配置重度混淆,性能低性能下降50-100%{"compact":true,"controlFlowFlattening":true,"controlFlowFlatteningThreshold":0.75,//设置为0到1之间的值"deadCodeInjection":tr......
  • linux 配置java环境变量
    1.下载与安装查看操作系统位数uname-m如果输出是x86_64,那么你的系统是64位的;如果输出是i686或i386,那么你的系统是32位的。openJDK下载地址:清华大学开源软件镜像站以jdk11为例,下载地址为:https://mirror.tuna.tsinghua.edu.cn/Adoptium/11/jdk/x64/linux/OpenJDK11U-jdk_x......
  • JavaScript ES6 新特性探索:Proxy 解锁编程新境界
    个人主页:学习前端的小z个人专栏:JavaScript精粹本专栏旨在分享记录每日学习的前端知识和学习笔记的归纳总结,欢迎大家在评论区交流讨论!ES5、ES6介绍文章目录......
  • 【JavaWeb】基于Filter和Interceptor实现登录认证
    前言HTTP协议是无状态协议,指的是每一次请求都是独立的,下一次请求并不会携带上一次请求的数据。因为HTTP协议是无状态的,两次请求之间是独立的,所以是无法判断这个员工到底登陆了没有。登录校验的具体的实现思路可以分为两部分:在员工登录成功后,需要将用户登录成功的信息存起来,记......
  • javaScript获取dom元素的常见方法
    前端开发都知道在react、vue等框架没问世之前,开发人员要实现用户对网页元素进行操作时,其中就包括dom元素的选择,不可避免的就是要获取到目标元素再接着编写功能代码。废话少说让我们来看看javaScript获取dom元素的常见方法元素js获取dom元素的方法常有以下几种:1.两个......