java 调用js 解析yml_windows java -jar 运行yml 无法解析nacos MalformedInputException: Input length = 1...

在Windows环境下,使用`java -jar`命令运行一个jar包时遇到了错误。当尝试从Nacos读取并解析YML配置时,出现了`MalformedInputException: Input length = 1`。错误出现在SnakeYAML库中,具体为`StreamReader`在处理数据时。尽管在IDEA中调试没有问题,但在命令行执行jar包时,配置可能需要调整。
摘要由CSDN通过智能技术生成

环境信息 (必填)

pigx版本: 3.8

是否修改包名: 否

描述(无法理解工单,将直接关闭)

日志、截图、回显步骤

按教程将demo-biz 产生jar包 通过 java -jar demo-biz.jar 命令执行遇到错误,但直接在 idea中debug执行是可以的, 是因为nacos配置什么地方需要调整么

D:\pig\new model\demo\demo-biz\target

λ java -jar demo-biz.jar

2020-06-04 23:16:29.123 INFO 19564 --- [ main] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances

2020-06-04 23:16:29.220 INFO 19564 --- [ main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy

2020-06-04 23:16:29.223 INFO 19564 --- [ main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource bootstrap [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper

2020-06-04 23:16:29.225 INFO 19564 --- [ main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper

2020-06-04 23:16:29.226 INFO 19564 --- [ main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper

2020-06-04 23:16:29.228 INFO 19564 --- [ main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper

2020-06-04 23:16:29.229 INFO 19564 --- [ main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource springCloudClientHostInfo [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper

2020-06-04 23:16:29.230 INFO 19564 --- [ main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/bootstrap.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper

2020-06-04 23:16:29.289 INFO 19564 --- [ main] c.u.j.filter.DefaultLazyPropertyFilter : Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter

2020-06-04 23:16:29.297 INFO 19564 --- [ main] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver

2020-06-04 23:16:29.303 INFO 19564 --- [ main] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector

::::::::: ::::::::::: :::::::: ::: :::

:+: :+: :+: :+: :+: :+: :+:

+:+ +

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Caused by: java.nio.charset.MalformedInputException: Input length = 1是一个错误信息,在启动springboot项目时可能会出现。这个错误通常是由于字符编码不统一导致的。 解决这个问题的方法有以下几种: 1. 将application.yml文件的编码格式改为UTF-8。 2. 如果你的application.yml文件是通过把其他类型的文件后缀名直接改为yml生成的,那么你需要将application.yml中的内容复制并删除,然后新建一个application.yml文件,并将复制的内容粘贴进去。这样运行项目就不会报错了。 3. 从根本上解决问题:进入IDEA的设置中,找到Editor -> File Encodings,将编码格式修改为正确的格式,如UTF-8。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [java bug汇总——Caused by: java.nio.charset.MalformedInputException: Input length = 1](https://blog.csdn.net/qq_44633541/article/details/124948573)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [springboot Caused by: java.nio.charset.MalformedInputException: Input length = 1](https://blog.csdn.net/yaoyulan21/article/details/114369416)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值