SpringBOOT基础学习
See_NUMB
这个作者很懒,什么都没留下…
展开
-
Springboot JpaRepository repository.findOne() 方法报错
repository.findOne(id)出错你可能使用的SpringBoot 2.0以上的版本,可以直接改为:repository.findById(id).get(),就可以解决问题原创 2020-06-14 16:10:21 · 422 阅读 · 0 评论 -
springboot日志logging的配置
日志输出可以分为:控制台输出和文件输出日志级别:TRACE < DEBUG < INFO < WARN < ERROR < FATAL如果设置为 WARN ,则低于 WARN 的信息都不会输出。Spring Boot 中默认配置 ERROR 、 WARN 和 INFO 级别的日志输出到控制台。控制台输出LoggerTest类@SpringBootTest@Slf4jpublic class LoggerTest {// private final原创 2020-06-10 19:50:37 · 862 阅读 · 0 评论 -
org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under
原application.yml配置logging: pattern: console: "%d - %msg%n" file: path: /var/log/tomcat/sell level: debug原因: logging不能顶格,logging前面加两个空格修改后: logging: pattern: console: "%d - %msg%n" file: path: /var/log/tomcat/sell level: debug原创 2020-06-10 11:07:27 · 3516 阅读 · 0 评论 -
IDEA使用注解@ConfigurationProperties出错
出错显示:ot registered via @EnableConfigurationProperties, marked as Spring component, or scanned via @ConfigurationPropertiesScan 解决办法:在@ConfigurationProperties前面加注解@Component@Component@ConfigurationProperties(prefix = "girl")...原创 2020-05-23 22:07:49 · 495 阅读 · 0 评论