The elements [xxx.xxxxx] were left unbound.

错误信息:

***************************
APPLICATION FAILED TO START
***************************

Description:

Binding to target [Bindable@7125333 type = com.cplh.gis.config.ApplicationProperties, value = 'provided', annotations = array<Annotation>[@org.springframework.boot.context.properties.ConfigurationProperties(prefix=application, value=application, ignoreUnknownFields=false, ignoreInvalidFields=false)]] failed:

    Property: application.upload-path
    Value: D:/demo
    Origin: "application.upload-path" from property source "applicationConfig: [classpath:/config/application-dev.yml]"
    Reason: The elements [application.upload-path] were left unbound.

Action:

Update your application's configuration

解决办法:

方法一:把application.upload-path改成xxx.update-path,只要xxx不等于常用的配置关键字

方法二:

首先看一下启动的配置文件是不是当前设置的值的文件,不要在dev里配置了upload-path启动的是prod的配置文件

然后在项目的config文件夹下新建java文件ApplicationProperties.java(如果有就不需要创建了)

import org.springframework.boot.context.properties.ConfigurationProperties;


@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
public class ApplicationProperties {

	private String uploadPath;


	public String getUploadPath() {
		return uploadPath;
	}

	public void setUploadPath(String uploadPath) {
		this.uploadPath = uploadPath;
	}
	
}

参考文章:https://blog.csdn.net/weixin_44864748/article/details/108264627

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

工程师小A

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值