SpringCloud项目启动失败 not found config file[log.properties]

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介: SpringCloud项目启动失败 not found config file[log.properties]

SpringCloud项目启动失败 not found config file[log.properties]


not found config file[log.properties]
2022-03-31 09:15:08.010 ERROR [com.xxx.xxxx.common.config.file.FileConfig]  not found config file[log.properties]
Exception in thread "main" java.lang.ExceptionInInitializerError
  at com.xxx.xxxx.common.config.ApplicationConfig.initApplicationContext(ApplicationConfig.java:35)
  at com.xxx.xxxx.common.config.ApplicationConfig.<init>(ApplicationConfig.java:23)
  at com.xxx.xxxx.common.config.ApplicationConfig.<clinit>(ApplicationConfig.java:16)
  at com.xxx.job.executor.config.InitConfig.<clinit>(InitConfig.java:43)
  at com.xxx.job.executor.Application.main(Application.java:24)
Caused by: java.lang.NullPointerException
  at java.io.FileInputStream.<init>(FileInputStream.java:130)
  at java.io.FileInputStream.<init>(FileInputStream.java:93)
  at com.xxx.xxxx.common.config.file.FileConfig$BaseConfig.getProperties(FileConfig.java:105)
  at com.xxx.xxxx.common.config.file.FileConfig$BaseConfig.configToContext(FileConfig.java:114)
  at com.xxx.xxxx.common.config.file.FileConfig.initApplicationContext(FileConfig.java:88)
  at com.xxx.xxxx.common.config.file.FileConfig.<init>(FileConfig.java:43)
  at com.xxx.xxxx.common.config.file.FileConfig.<clinit>(FileConfig.java:36)
  ... 5 more


运行环境不对,Run Configuration ,在 Application 中选择 Modify Run Configuration


b7ec4fec45ee4edc8ef0e36040fa97c4.png


在打开的窗口中,Working Directory 最右边的图标(Insert Macros...)


b888d045bc9045fe8027afa19b9ebaa9.png


选择 $MODULE_WORKING_DIR$


c32dafa5e92a4cecbeb1555e76bb7e8e.png

bbc0311618a5436c9a3006f979e1a509.png


OK 即可

相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
目录
相关文章
|
8天前
|
Java 开发工具 对象存储
简化配置管理:Spring Cloud Config与Netflix OSS中的动态配置解决方案
简化配置管理:Spring Cloud Config与Netflix OSS中的动态配置解决方案
21 2
|
2月前
|
Cloud Native Java Nacos
Spring Cloud Config、Apollo、Nacos和Archaius对比
这篇文章对比了Spring Cloud Config、Apollo、Nacos和Archaius这四种配置中心的适应场景、优缺点。文中讨论了它们的功能特点,例如Spring Cloud Config的集中化配置管理和动态刷新能力,Apollo的实时配置推送和权限治理,Nacos的服务发现和管理功能,以及Archaius的动态配置更新能力。文章指出选择配置中心应根据项目需求和架构来决定,并提供了一个对比图来帮助读者更直观地理解这些工具的差异。
37 1
Spring Cloud Config、Apollo、Nacos和Archaius对比
|
9天前
|
Java API 开发者
【已解决】Spring Cloud Feign 上传文件,提示:the request was rejected because no multipart boundary was found的问题
【已解决】Spring Cloud Feign 上传文件,提示:the request was rejected because no multipart boundary was found的问题
|
2月前
|
JSON 中间件 Go
go语言后端开发学习(四) —— 在go项目中使用Zap日志库
本文详细介绍了如何在Go项目中集成并配置Zap日志库。首先通过`go get -u go.uber.org/zap`命令安装Zap,接着展示了`Logger`与`Sugared Logger`两种日志记录器的基本用法。随后深入探讨了Zap的高级配置,包括如何将日志输出至文件、调整时间格式、记录调用者信息以及日志分割等。最后,文章演示了如何在gin框架中集成Zap,通过自定义中间件实现了日志记录和异常恢复功能。通过这些步骤,读者可以掌握Zap在实际项目中的应用与定制方法
go语言后端开发学习(四) —— 在go项目中使用Zap日志库
|
2月前
|
Java Spring
【Azure Spring Cloud】Spring Cloud Azure 4.0 调用Key Vault遇见认证错误 AADSTS90002: Tenant not found.
【Azure Spring Cloud】Spring Cloud Azure 4.0 调用Key Vault遇见认证错误 AADSTS90002: Tenant not found.
|
2月前
|
开发框架 .NET Docker
【Azure 应用服务】App Service .NET Core项目在Program.cs中自定义添加的logger.LogInformation,部署到App Service上后日志不显示Log Stream中的问题
【Azure 应用服务】App Service .NET Core项目在Program.cs中自定义添加的logger.LogInformation,部署到App Service上后日志不显示Log Stream中的问题
|
2月前
|
XML Java Maven
logback在springBoot项目中的使用 springboot中使用日志进行持久化保存日志信息
这篇文章详细介绍了如何在Spring Boot项目中使用logback进行日志记录,包括Maven依赖配置、logback配置文件的编写,以及实现的日志持久化和控制台输出效果。
logback在springBoot项目中的使用 springboot中使用日志进行持久化保存日志信息
|
2月前
|
数据可视化 Java API
如何在项目中快速引入Logback日志并搭配ELK使用
如何在项目中快速引入Logback日志并搭配ELK使用
|
2月前
|
开发框架 .NET API
如何在 ASP.NET Core Web Api 项目中应用 NLog 写日志?
如何在 ASP.NET Core Web Api 项目中应用 NLog 写日志?
|
2月前
|
监控 程序员 数据库
分享一个 .NET Core Console 项目中应用 NLog 写日志的详细例子
分享一个 .NET Core Console 项目中应用 NLog 写日志的详细例子

热门文章

最新文章

下一篇
无影云桌面