- 博客(664)
- 资源 (1)
- 收藏
- 关注
原创 IDEA启动项目java.lang.OutOfMemoryError: GC overhead limit exceeded
直接扩大 shared build process heap size 解决问题。
2024-01-20 12:34:13 624
原创 IntelliJ Idea mapstruct java: Internal error in the mapping processor: java.lang.NullPointerExceptio
升级mapstruct版本到1.4.1.Final 问题解决。
2024-01-20 12:33:10 937
原创 axios multipart/form-data boundary 缺失 nodejs
axios 默认使用multipart/form-data 请求的时候,会丢失boundary,需要手工设置。
2023-06-08 17:36:28 1061
原创 JavaMail requires an InputStreamSource that creates a fresh stream for every call.
JavaMail requires an InputStreamSource that creates a fresh stream for every call.
2022-06-24 15:24:41 887
原创 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
SQL 当使用in 拼接 的时候当in中没有数据的时候,会包错如上如 AND (item_id IN ())需要在上游做空数组判断
2022-05-23 15:31:43 604
原创 IDEA 2022版本没有commit 对话框
老版本的IDEA 在project 下面都有一个commit 的对话框,但是在2022版本默认没有这个打开方式:setting->version contrl ->commit ->勾选上use no-modal commit interface ,则还原为老版本新版本推荐直接使用ctrl+k,呼唤出新的commit 提交对话框参考文档:https://www.jetbrains.com/help/idea/commit-changes-dialog.html...
2022-05-22 10:16:03 10771 1
原创 org.springframework.beans.factory.annotation.value 防止不存在报错Could not resolve placeholder
@Value("${base.name?:'hehe'}")String name;当在application.yml 中没有配置base.name的时候,系统会报错:Could not resolve placeholder常规解决办法是补充一个配置也可以在@Value 值中通过三元运算符设置一个默认值...
2022-05-21 17:03:37 1293
原创 SpringBoot Cloud 配置优先级问题
第一优先级 JVM配置-Dbase.name=456第二优先级application.yml 或者application.properties第三优先级bootstrap.yml 后者bootstrap.properties
2022-05-21 16:08:34 391
原创 Springboot org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit
SpringBootTest 测试用例中,当引入@Autowird 一个包含 @Test 的类的时候,会报告找不到,autowird 的类不能有@test 测试否则报告UnsatisfiedDependencyException,无法加载该类
2022-05-17 15:34:54 644
原创 ScopeNotActiveException 异常
@Scope(value = WebApplicationContext.SCOPE_REQUEST)修改为@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)问题解决Unsatisfied dependency expressed through field 'subClass'; nested exception is org.springframework.b
2022-05-17 12:45:33 1240
原创 mvn test 指定suit
方法1:使用命令行 mvn -DrunSuite=**/Junit5Suit test 2.配置POM <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <includes>.
2022-05-16 10:53:41 476
原创 MockMultipartFile mock文件上传
ClassPathResource resource = new ClassPathResource("XXX.js"); MockMultipartFile mfile = new MockMultipartFile("file", "XXX.js", "png", resource.getInputStream()); MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.multipart("/XX..
2022-05-13 17:13:49 8313
原创 fastJson的 引号兼容性
fastJson 支持 key不带引号,带带引号和双引号如下都能够正确parseTestClass test = JSON.parseObject(data,TestClass.class);{ "id": 4, 'label': "TTT 1/TTT", title: "TTTT", "path": "/TTTT"} <dependency> <groupId>com.alibaba</groupId>
2022-05-13 11:35:49 1335
原创 JAVA 中 JSON文件的读取
package com.example.demo.jsonParse;import com.alibaba.fastjson.JSON;import org.junit.jupiter.api.Test;import org.springframework.core.io.ClassPathResource;import org.springframework.util.FileCopyUtils;import java.io.IOException;import java.nio.char
2022-05-13 11:32:49 1841
原创 Junit4 Suite.SuiteClasses升级 junit5
在junit5 中已经没有Suite.SuiteClasses需要替换为org.junit.platform.suitejuni4代码@RunWith(Suite.class)@Suite.SuiteClasses({Junit4_1Test.class,Junit4Test.class})public class OneTest {}junit5代码@IncludeTags("production")@Suite@SelectPackages({"com.example.demo.
2022-05-12 18:27:44 456
原创 SpringBoot使用cobertura-maven-plugin生成代码覆盖率报表
pom配置 <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin>
2022-05-12 16:17:59 249
原创 springboot 中 logging.config 的 logback默认配置文件地址
在springboot 配置logback 配置文件路径的时候当logging.config 不特殊指定基于约定默认加载:resources文件夹下的logback-spring.xml 文件
2022-05-11 12:51:51 4237
原创 No qualifying bean of type:scanBasePackages
Spring Boot 默认扫描当前包及子包如果需要加载其它包,需要增加scanBasePackages@SpringBootApplication(scanBasePackages = {“com.XXX”})用以解决:No qualifying bean of type问题
2022-05-06 11:56:02 357
原创 findAnnotation与getAnnotation的区别
findAnnotation:递归向上查找superclass,直到找到为止getAnnotation:仅仅查找本类的
2022-05-06 10:35:39 624
原创 当一个方法下线,@Deprecated ,需要指向另外一个方法时候
当一个方法下线,@Deprecated ,需要指向另外一个方法时候参见Date 的getYear * @see java.util.Calendar * @deprecated As of JDK version 1.1, * replaced by {@code Calendar.get(Calendar.YEAR) - 1900}.
2022-04-29 15:57:07 753
原创 微信小程序 抓包踩坑
微信小程序开发尝试抓包发现Android 无法完成抓包(android 普通浏览器能够抓Https,但是小程序无法抓包)IOS正常
2022-04-24 19:55:18 2894
原创 mybasticplus打印原始sql日志
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
2022-04-24 15:40:47 278
原创 SpringBoot max-threads设置方式(2.3 版本以后)
目前网上文章写设置SpringBoot tomcat 的max_threads 的方法为:server.tomcat.max-threads=250但是在springboot 2.3 以后已经修改为 server.tomcat.threads.max=400老的设置会不生效验证方法@Configurationpublic class EmbedTomcatConfig { @Bean WebServerFactoryCustomizer<ConfigurableServle
2022-04-20 16:52:05 4061
原创 Dubbo默认超时时间
默认超时时间为1秒(1000毫秒)消费者单个服务的超时时间限制@DubboReference(version = "1.0.0" ,timeout = 2000)全局设置dubbo: consumer: timeout: 2000
2022-04-20 10:33:10 3560
原创 rampUp时间 jmeter
官方解释首先说明结论是:ramp up的值应该是启动全部线程所需的时间。就像官方的例子:我需要启动10个线程,并且10s启动一个线程,所以我的ramp up的值就是10*10=100s。我需要启动30个线程,并且设置的ramp up的值是120s,那我就是120/30=4s每4秒启动一个线程。参考文档:https://www.jianshu.com/p/018bc03d26c3...
2022-04-15 10:05:21 2146
原创 deprecated注释 原因
@Deprecated 标记下线接口或者属性的时候,希望能够说明下线原因及新的方法地址可以使用注释 /** * @deprecated 我为什么要下线这个字段或者方法,替代的字段或者方法是 {@link com.example.demo.SimpleCache.CacheObj#longData} */ @Deprecated private BigDecimal decimal;使用方看到的效果...
2022-04-14 11:48:27 338
原创 基于ConcurrentHashMap 最简单无超时时间的本地缓存类
基于:ConcurrentHashMap无缓存过期时间仅仅有缓存最大大小package com.example.demo.SimpleCache;import java.util.Map;import java.util.concurrent.ConcurrentHashMap;public class SimpleSimpleCacheUtils { private static final Integer CACHE_MAX_NUMBER = 100; private s
2022-04-12 19:43:24 665
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人