![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring Boot
代码搬晕工
热爱生活
展开
-
修改request的body参数和header
修改request的body参数和header原创 2022-05-07 14:32:56 · 2622 阅读 · 0 评论 -
升级JDK11报 com.sun.tools.javac.code.TypeTags
把lombok升级到1.18.2版本或以上<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.2</version></dependency>原创 2021-01-22 17:46:00 · 1958 阅读 · 0 评论 -
Spring @Value赋值给静态变量
配置user: api2: message: a message1: b message2: c message3: d message4: e1.//类加@Component注解 否则Spring启动@Value不生效private static String message;@Value("${user.api2.message}")public void setMessage3(String message){ message =原创 2021-01-15 15:53:44 · 133 阅读 · 0 评论 -
Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:<unknown>
微服务版本升级spring cloud升级到 Hoxton.SR9 版本 spring boot升级到2.3.7.RELEASE 之后子模块报Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:<unknown>最开始没升级版本的时候spring-boot-maven-plugin也没写版本号 也没报错加了版本号之后还是报错 报啥没记录 也是类似Cannot resolve plu.原创 2021-01-12 22:25:25 · 6990 阅读 · 1 评论 -
spring boot ehcache 异常: check your configuration (caching type is ‘EHCACHE‘)
Caused by: java.lang.IllegalArgumentException: No cache manager could be auto-configured, check your configuration (caching type is 'EHCACHE') at org.springframework.util.Assert.notNull(Assert.java:218) at org.springframework.boot.autoconfigure.cache.Ca.原创 2021-01-10 15:41:30 · 3132 阅读 · 0 评论 -
Spring Boot 更新、清除多个缓存
使用 注解 @Caching ,源码如下@Target({ElementType.TYPE, ElementType.METHOD})@Retention(RetentionPolicy.RUNTIME)@Inherited@Documentedpublic @interface Caching { Cacheable[] cacheable() default {}; CachePut[] put() default {}; CacheEvict[] evict(原创 2020-10-21 17:57:37 · 935 阅读 · 0 评论 -
JpaObjectRetrievalFailureException: Unable to find xxx with id 1
在使用spring boot + jpa时遇到错误如下org.springframework.orm.jpa.JpaObjectRetrievalFailureException: Unable to find com.xxxx with id 1;nested exception is javax.persistence.EntityNotFoundException: Unable to find com.xxxx with id 1发现是使用 getOne() 方法报错根据错误信息 .原创 2020-10-14 17:34:48 · 6083 阅读 · 1 评论 -
Spring Boot Druid 配置
初次使用 Druid 数据连接池,使用配置做个记录,仅供参考,相互学习,望不吝啬指教Druid 中文官方文档spring: datasource: type: com.alibaba.druid.pool.DruidDataSource platform: mysql url: jdbc:mysql://localhost:3306/test?characterEncoding=utf8&serverTimezone=UTC username: root原创 2020-09-19 23:38:45 · 436 阅读 · 0 评论 -
Spring cloud集成Eureka启动报错java.lang.ArrayStoreException: ***.TypeNotPresentExceptionProxy
初学Spring cloud,集成Eureka启动报错java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy启动数组越界。。。这肯定不正常找到这个类断点该类的构造函数发下另有错误!可以看出真正的错误是:java.lang.ClassNotFoundException: org.springframework.cloud.context.scope.refresh.Refresh原创 2020-06-19 16:34:50 · 942 阅读 · 4 评论 -
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
使用Spring boot 集成Hibernate 出现错误java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException引入jaxb-api 即可<dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0&.原创 2020-06-16 11:49:35 · 212 阅读 · 0 评论 -
java.lang.NoClassDefFoundError: nl/jworks/markdown_to_asciidoc/Converter
Spring Boot 项目时用 Swagger2Markup 生成静态文档遇到的问题代码:@Testpublic void remoteSwaggerFile() throws MalformedURLException { URL remoteSwaggerFile = new URL("http://localhost:8888/v2/api-docs"); Path outputDirectory = Paths.get("src/docs/asciidoc/generated");转载 2020-06-11 16:07:13 · 6098 阅读 · 12 评论 -
SpringBoot使用spring-data-jpa多数据源报Failed to load ApplicationContext
错误信息`java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDe...原创 2020-04-22 14:09:24 · 585 阅读 · 1 评论 -
spring boot报错 java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' 解决
转载:https://www.cnblogs.com/cn-chy-com/p/10145690.html第一个错误信息Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatic...转载 2020-04-02 17:28:04 · 280 阅读 · 0 评论