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 即可

相关实践学习
通过日志服务实现云资源OSS的安全审计
本实验介绍如何通过日志服务实现云资源OSS的安全审计。
目录
相关文章
|
7月前
|
Java 微服务 Spring
微服务——SpringBoot使用归纳——Spring Boot使用slf4j进行日志记录——使用Logger在项目中打印日志
本文介绍了如何在项目中使用Logger打印日志。通过SLF4J和Logback,可设置不同日志级别(如DEBUG、INFO、WARN、ERROR)并支持占位符输出动态信息。示例代码展示了日志在控制器中的应用,说明了日志配置对问题排查的重要性。附课程源码下载链接供实践参考。
824 0
|
5月前
|
Java 应用服务中间件 Linux
Tomcat运行日志字符错乱/项目启动时控制台日志乱码问题
总结: 通过以上几种方法,概括如下:指定编码格式、设置JVM的文件编码、修改控制台输出编码、修正JSP页面编码和设置过滤器。遵循这些步骤,你可以依次排查和解决Tomcat运行日志字符错乱及项目启动时控制台日志乱码问题。希望这些建议能对你的问题提供有效的解决方案。
994 16
|
10月前
|
人工智能 监控 算法
3D-Speaker:阿里通义开源的多模态说话人识别项目,支持说话人识别、语种识别、多模态识别、说话人重叠检测和日志记录
3D-Speaker是阿里巴巴通义实验室推出的多模态说话人识别开源项目,结合声学、语义和视觉信息,提供高精度的说话人识别和语种识别功能。项目包含工业级模型、训练和推理代码,以及大规模多设备、多距离、多方言的数据集,适用于多种应用场景。
2048 18
3D-Speaker:阿里通义开源的多模态说话人识别项目,支持说话人识别、语种识别、多模态识别、说话人重叠检测和日志记录
|
10月前
|
Java Maven
java项目中jar启动执行日志报错:no main manifest attribute, in /www/wwwroot/snow-server/z-server.jar-jar打包的大小明显小于正常大小如何解决
在Java项目中,启动jar包时遇到“no main manifest attribute”错误,且打包大小明显偏小。常见原因包括:1) Maven配置中跳过主程序打包;2) 缺少Manifest文件或Main-Class属性。解决方案如下:
2384 8
java项目中jar启动执行日志报错:no main manifest attribute, in /www/wwwroot/snow-server/z-server.jar-jar打包的大小明显小于正常大小如何解决
|
11月前
|
JSON Java 数据库
SpringBoot项目使用AOP及自定义注解保存操作日志
SpringBoot项目使用AOP及自定义注解保存操作日志
228 1
|
Cloud Native Java Nacos
Spring Cloud Config、Apollo、Nacos和Archaius对比
这篇文章对比了Spring Cloud Config、Apollo、Nacos和Archaius这四种配置中心的适应场景、优缺点。文中讨论了它们的功能特点,例如Spring Cloud Config的集中化配置管理和动态刷新能力,Apollo的实时配置推送和权限治理,Nacos的服务发现和管理功能,以及Archaius的动态配置更新能力。文章指出选择配置中心应根据项目需求和架构来决定,并提供了一个对比图来帮助读者更直观地理解这些工具的差异。
477 1
Spring Cloud Config、Apollo、Nacos和Archaius对比
|
Java 开发工具 对象存储
简化配置管理:Spring Cloud Config与Netflix OSS中的动态配置解决方案
简化配置管理:Spring Cloud Config与Netflix OSS中的动态配置解决方案
194 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.
268 1
|
开发框架 .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中的问题
172 1
|
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的问题
1684 0

热门文章

最新文章