strom-java成长之路
strom-java成长之路
行人已
小白程序员进阶路
展开
-
Maven打包错误: updates are forced and ‘parent.relativePath‘ points at wrong local POM
'version' contains an expression but should be a constant原创 2023-07-07 15:09:19 · 3174 阅读 · 0 评论 -
maven:解决‘parent.relativePath‘ of POM xxx points at instead of please verify your project structure
1、默认我们不用写,那默认值就是 …/pom.xml,会从本地路径中获取parent的pom!默认顺序:relativePath > 本地仓库 > 远程仓库。2、 指定了relativePath,但值是空的,设定一个空值将始终从仓库中获取,不从本地路径获取.这个报警其实可以忽略,但是作为强迫症的同学来说真的很不习惯!在pom.xml 的 标枪加上。原创 2023-03-24 15:26:01 · 1173 阅读 · 1 评论 -
java:springboot 整理webSocket
java:springboot 整理webSocket原创 2022-11-22 14:34:51 · 709 阅读 · 0 评论 -
JAVA: Java.lang.IllegalStateException javax.websocket.server.ServerContainer not availableJ
java.lang.IllegalStateException: javax.websocket.server.ServerContainer not available原创 2022-11-10 16:13:10 · 3627 阅读 · 3 评论 -
java: java.nio.charset.MalformedInputException: Input length = 1
java.nio.charset.MalformedInputException: Input length = 1原创 2022-06-29 10:25:28 · 497 阅读 · 0 评论 -
java :java.nio.charset.MalformedInputException: Input length = 1
用迷离的舞步,跟随着最后一丝月光的脚步1、问题背景 ------今天在启动项目报如下错误: java :java.nio.charset.MalformedInputException: Input length = 1 2、问题原因编码问题,导致idea编辑器读取yml文件失败3、问题解决3.1、改变编码格式为:utf-8 idea编辑器:file>settting>editor>encodings 3.2 上述方法还报错后,直接删除yml的中.原创 2022-05-23 18:02:29 · 761 阅读 · 0 评论 -
go : 使用 grom 删除数据库数据
你受的苦 吃的亏 担的责 扛的罪 忍的痛 到最后都会变成光 照亮你的路 !!!代码已放在:https://gitee.com/hjx_RuGuoYunZhiDao/strom-huang-go可参照文档:https://learnku.com/docs/gorm/v2/create/9732#e9dfd91、 引入gorm import ( "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger")2、链接数据库dsn .原创 2022-05-13 11:59:00 · 1690 阅读 · 0 评论 -
springboot: The dependencies of some of the beans in the application context form a cycle:
1、代码报错异常信息:The dependencies of some of the beans in the application context form a cycle: memberCenterController (field private SysUserService MemberCenterController.userService)┌─────┐| sysUserServiceImpl defined in file [SysUserServiceImpl.class原创 2022-04-29 20:57:18 · 1845 阅读 · 0 评论 -
Mysql Varchar类型 字段排序
Mysql Varchar类型 字段排序1、问题描述:当列表需要字段大小排序的时候,但是数据库字段是Varchar类型的,如果仔细看就会发现并没有按照预期来拍,比如:不是按照:10,9,8,7 这样来的~如果是varchar 类型其实照字符串来排的,我的理解就一排一排来排序,第一排数值比对,然后在第二排。。2、问题解决:在排序的字段后**+0** ORDER BY (字段+0) asc为什么+0后可以,是因为+0后转换成INT类型排序了, 这样就可以按照大小排序了使用MySQL函数C原创 2022-03-15 18:00:01 · 5111 阅读 · 0 评论 -
JAVA FastJson 返回参数为空过滤
1、问题原因使用FastJson 如果返回结果中有空的字段会过滤2、问题解决@Configurationpublic class ConverterConfig { @Bean @Order(Integer.MIN_VALUE) public HttpMessageConverters fastJsonHttpMessageConverters() { FastJsonHttpMessageConverter fastConverter = new Fast原创 2022-02-22 16:55:49 · 930 阅读 · 0 评论 -
non-static inner classes like this can only by instantiated using default, no-argument constructor
1、问题原因后端使用 @RequestBody 来接受参数前端出入json后报错2、问题解决问题本质为:内部非静态类无法实例化public class A { class B; class B{ int id ; }}get + set 这里是错误的 ,正确应该是public class A { class B; static class B implements Serializable{ int id ; }}...原创 2021-10-21 12:06:45 · 11881 阅读 · 1 评论 -
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites
1、问题描述:本地开发测试成功,但是线上环境有问题在使用 spring-boot-starter-mail 发送gmail邮件 报错:xxxx:465xxxxjavax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) at sun.security.ssl.Handshaker.activate(Handshaker.j原创 2021-10-14 11:17:21 · 476 阅读 · 0 评论 -
Javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/continue?
1、问题描述使用gmail 发送邮件vax.mail.AuthenticationFailedException: 534-5.7.14 Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754 s8sm1528084ots.38 - gsmtpat com.sun.原创 2021-10-14 10:49:15 · 588 阅读 · 0 评论 -
Mybatis:caused by: org.apache.ibatis.builder.BuilderException : Error evaluating expression ‘‘
1、报错信息caused by: org.apache.ibatis.builder.BuilderException : Error evaluating expression ''xxxxxxxxxxxxxxxxxx2、我遇到的报错场景传入:type==null @Param("s") 实体类 <if test="s.type !=null"> and type=#{s.type} </if>3、解决方法在外面增加一层判原创 2021-10-10 19:30:38 · 2138 阅读 · 0 评论 -
ubantu:fatal: unable to access ‘http://github.com/‘: Failed to connect to 127.0.0.1 port 1080:
1、报错信息fatal: unable to access 'http://github.com/xx/xxx.git/': Failed to connect to 127.0.0.1 port 1080: Connection refused2、问题解决将https修改为git就好了eg: git clone https://github.com/xxx/xxxx.gitfatal: unable to access 'http://github.com/xx/xxx.git/':原创 2021-08-24 13:38:36 · 310 阅读 · 0 评论 -
springboot 微信公众号开发
客官可直接移步到代码https://gitee.com/hjx_RuGuoYunZhiDao/strom-huang-wechat原创 2021-08-13 16:53:17 · 105 阅读 · 0 评论 -
多模块:The injection point has the following annotations: @org.springframework.beans.factory.annotatio
1、场景springboot多模块引用的时候会出现没有扫描到所在的包,其实也会是mavn引入了2、报错信息3、问题解决:Autowired 根据类型去spring容器找,找不到那个类,就会报错!只需要在 springboot启动类上添加扫描的包就可以了@ComponentScan(basePackages = "com.xxx.service")@MapperScan("com.xxx.mapper")...原创 2021-08-01 23:25:59 · 2828 阅读 · 1 评论 -
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
1、问题描述org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.<init>(My原创 2021-07-21 16:45:01 · 83 阅读 · 0 评论 -
web3j okhttp3.RequestBody.create(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody
1、问题原因高版本okhttp 和web3j版本有冲突2、问题解决pom文件 <!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp --> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</a原创 2021-07-15 19:20:15 · 921 阅读 · 0 评论 -
org.junit.platform.commons.JUnitException: TestEngine with ID ‘junit-vintage‘ failed to discover tes
1、问题解决springboot----------------------------------------@SpringBootTest@RunWith(SpringRunner.class)![在这里插入图片描述](https://img-blog.csdnimg.cn/20210715172316137.png#pic_center)pom <dependency> <groupId>junit</groupId&g原创 2021-07-15 17:24:47 · 3342 阅读 · 0 评论 -
org.springframework.dao.InvalidDataAccessApiUsageException: ERR wrong number of arguments for ‘srem‘
1、报错信息org.springframework.dao.InvalidDataAccessApiUsageException: ERR wrong number of arguments for 'srem' command; nested exception is redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'srem' command at org.spri原创 2021-07-05 12:05:14 · 1019 阅读 · 0 评论 -
unbantu-nginx安装 + 简单配置
apt-get安装nginxapt-get install nginx查看nginx是否安装成功nginx -v启动nginxservice nginx startservice nginx restartservice nginx stop启动后,在网页重输入ip地址,即可看到nginx的欢迎页面。如果没有看看放火墙开放了80端口没有+ 服务器设置里面的外放端口设置http://ip配置文件在:/etc/nginx 配置 nginx.confserver{原创 2021-06-29 10:50:48 · 159 阅读 · 0 评论 -
kafka: ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
window启动kafka报错:ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)kafka.common.InconsistentClusterIdException: The Cluster ID fESar1C0RH6tml3NB3N2Mw doesn't match stored clusterId Some(7DWuwcd0SgmM4PoafW2LSQ) in原创 2021-06-14 12:53:32 · 2636 阅读 · 0 评论 -
com.alibaba.fastjson.JSONException: syntax error, expect {, actual string, pos 21612158, fastjson-ve
1、报错写法String str= JSON.toJSONString(Object) T t= JSON.parseObject(str, T.class)2、修改后Object jsonObject = JSON.parse(s);T = JSON.parseObject(jsonObject.toString(), T.class);原创 2021-06-10 10:59:29 · 530 阅读 · 0 评论 -
List 数组里面是LinkedHashMap 怎么转换成 ArrayList
1、List格式2、解决方式//里面是 linkedHashMapList<Object> ObjectList = new ArryList();//第一种方式ObjectMapper mapper = new ObjectMapper();List<T> beanList = mapper.convertValue(ObjectList, new TypeReference<List<T>>() { }); //第二种 String原创 2021-06-07 10:33:08 · 1690 阅读 · 0 评论 -
ServerWebExchange 请求头丢失了
1、问题描述:在使用微服务的时候 前端转发的请求头参数需要用 implements GlobalFilter, Ordered 中ServerWebExchange 来硬编码转发,但是发现发现待 “_” 的参数没有了,比如:user_id 发现没有了2、问题解决其实也很简单,nginx 过滤掉了待下划线的参数,header 携带下划线的字段信息会被过滤掉,所以 user_id 就这么没了。解决配置ngix:underscores_in_headers on;service nginx rest原创 2021-06-02 00:30:23 · 1092 阅读 · 0 评论 -
Unable to parse the date: 2021-05-27T16:00:00.000Z
Unable to parse the date: 2021-05-27T16:00:00.000Z原因是:在格式化时间的时候,转成 “yyyy-MM-dd” 类型的数据的时候回报错!T表示分隔符,Z表示的是UTC。UTC:世界标准时间,在标准时间上加上8小时,即东八区时间,也就是北京时间。解决:Date:String dateTime = "2021-05-13T16:00:00.000Z";String strTime = dateTime.replace("Z", " UTC");原创 2021-05-28 19:04:09 · 3597 阅读 · 0 评论 -
java 正则判断字符串是否是中文
public static final String REGEX_ZH = "^[\\u4e00-\\u9fa5]+$"; public static final String REGEX_ZH_CONTAIT = "[\\u4e00-\\u9fa5]"; public static final String REGEX_ZH_REALESE = "[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:...原创 2021-05-26 17:03:06 · 1018 阅读 · 2 评论 -
sourceTree 修改项目账号密码
1、打开C盘目录至:C:\Users\xxx\AppData\Local\Atlassian\SourceTree2、修改目录下 userhosts 文件 eg:git地址用户名3、删除passwd 文件----(如果项目多的话 打开文件找到git地址下加密的密码删除掉,或者关于相关的git地址都删除)4、重新打开sourceTree ,会提示重新数据密码...原创 2021-05-26 16:51:17 · 1116 阅读 · 0 评论 -
lis对象里面是 LinkedHashMap转为 ArrayList
1、问题描述:redis通过管道查询 Json字符串直接序列化为 list<实体>,但是返回的是是ArrayList>. 明明是把ArrayList赋给List, 为什么代码在运行的时候不报错呢?因为泛型只是一个编译时期的概念,在运行的时候是不存在泛型的,只有List对象。所以上边的代码其实就是把ArrayList赋给List, 所以不报错2、问题解决: List<实体> list = new ArryList(); String s = JSON.toJSONStri原创 2021-05-19 19:40:59 · 936 阅读 · 1 评论 -
springboot 打包跳过测试
1、spirng 中 写法:<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version> <configuration>原创 2021-05-18 16:22:51 · 542 阅读 · 0 评论 -
Notepad++ 下载
官网链接:https://notepad-plus-plus.org/直接下载:Notepad++ Installer 64-bit x64链接:https://pan.baidu.com/s/1DJZFNEz4Kb6Pf-wkjJOzEg提取码:u02z原创 2021-05-16 10:24:51 · 194 阅读 · 0 评论 -
springboot-junit4: java.lang.IllegalStateException:Failed toload ApplicationContext
1、问题描述2、解决方案在接口上加入两个就好(只要这两个)@RunWith(SpringRunner.class)@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT,classes = Application.class)原创 2021-05-14 17:56:25 · 430 阅读 · 0 评论 -
springboot 解决 @Cacheable写入乱码的情况
1、在redis 集成管理中@Configuration@EnableCachingpublic class RedisConfig extends CachingConfigurerSupport { //MyRedisCacheManager 是自定义的 @Bean public CacheManager cacheManager() { RedisSerializer<String> redisSerializer = new StringRedis原创 2021-04-14 19:12:52 · 655 阅读 · 1 评论 -
MyBatis-plus 自动填充公共字段
1、不多逼逼-直接上代码---实体@Datapublic class BaseEntity { @TableField(value = "create_time", fill = FieldFill.INSERT) private String createTime; @TableField(value = "update_time", fill = FieldFill.UPDATE) private String updateTime;}@Comp原创 2021-04-12 18:08:29 · 128 阅读 · 0 评论 -
Mybatis-批量更新: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax
1、遇到错误nested exception is java.sql.sqlsyntaxerrorexception: you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near2、代码写法:<update id="updateByList" parameterType="java.uti原创 2021-04-09 00:37:40 · 923 阅读 · 0 评论 -
java.lang.NoClassDefFoundError:
1、使用springboot 跑项目的时候出现:java.lang.NoClassDefFoundError: com/develop/mnemonic/wordlists/WordList起初一直以为是没有初始化,最后发现是mavn的问题2、我的解决方法我的问题是我引入外部包: 重点 <dependency> <groupId>com.lgann.xx</groupId> <artifactId&原创 2021-03-03 15:30:56 · 189 阅读 · 1 评论 -
springboot 获取目录文件
1、应用场景Thread.currentThread().getContextClassLoader().getResourceAsStream 使用来导出Excel ,但是总是报空指针异常,发现是文件没有读取到!2、读取文件的方式方式一:ClassPathResource classPathResource = new ClassPathResource("template/xx.xlsx");InputStream inputStream = classPathResource.getIn原创 2021-01-28 18:26:03 · 2293 阅读 · 0 评论 -
java 数据拆分成List(模拟微信红包拆分)
public class SplitBigDecimalUtils { /** * 每个红包最小金额,单位为分 */ private static final int MIN_MONEY = 1; /** * 红包金额的离散程度,值越大红包金额越分散 */ private static final double DISPERSE = 10; /** * 根据剩余的红包金额和红包个数,获取一个红包的金额 *原创 2020-10-14 16:43:09 · 331 阅读 · 2 评论 -
java List分页后 批量入库
1、代码: List<Integer> testList = new ArrayList<>(); for (int i=0;i<=1000;i++){ testList.add(i); } //方法一 int listSize=testList.size(); int toIndex=500; for(int i = 0;i<testLi原创 2020-09-19 09:40:32 · 628 阅读 · 0 评论