
bug
bug
leo7moon
代码的搬运工
展开
-
mybatis异常Parsing error was found in mapping #{}占位符报错解决方案
1.存在 ‘#{’ 字符串查询的sql拼接拼接时,区分开’#’ 和’{’ 防止被识别成’#{'占位符concat(’#’,’{’,tab.key , ‘}’)错误示例:concat(’#{’,tab.key , ‘}’)xxxMapper.xml 代码:select * table1 t1 left join table2 t2 on t1.key = concat('#','{',t2.key , '}')2.其他:mybatis的#{}占位符和${} 拼接符的区别原创 2022-03-03 10:26:56 · 1368 阅读 · 0 评论 -
关于Oracle数据库varchar2字段超过4000的截取处理
1.问题描述:正式环境的旧系统使用的是oracle数据库,某表remarks备注字段最大长度是varchar2(4000),编码格式为UTF-8,可以存取4000字符和1333个中文字符串。上游系统推送的数据中,remarks的字符长度虽不超过4000字,但包含了中文字符,超过了4000,导致入库失败。经讨论过后,对不重要的字符进行截取入库处理。2.解决方案:截取超出的部分if (StringUtils.lengthOfUTF8(obj.getRemarks()) >= 4000) {原创 2022-02-25 15:46:27 · 4804 阅读 · 0 评论 -
idea启动tomcat报错 java.rmi.server.ExportException: Listen failed on port: 0
昨天还好好的项目,突然就报错,启动不了了:C:\Program Files\Java\jdk1.8.0_144\bin\java.exe…错误: 代理抛出异常错误: java.rmi.server.ExportException: Listen failed on port: 0; nested exception is: java.net.SocketException: Operation not supported: JVM_BindProcess finished with exit cod原创 2021-02-22 15:46:32 · 778 阅读 · 0 评论 -
mybatis-plus 更新策略之更新null字段
mybatisPlus 在使用其封装的方法进行更新实体类时,默认是不会去更新null字段的(会更新空字符串"")。然后我们的业务场景中经常会遇到需要更新null的情况,例如日期赋值为null,下面是处理方法:mybatis-plus FieldStrategy 有三种策略:IGNORED:0 忽略NOT_NULL:1 非 NULL,默认策略NOT_EMPTY:2 非空解决方案一1.实体的字段注解添加属性:strategy,但会在查询的时候也会拼接上null:birthday = nul.原创 2020-12-02 14:04:43 · 1581 阅读 · 0 评论 -
linux服务器双斜杠问题//导致找不到静态文件问题
springboot的controller返回view的html路径在linux部署的情况下找不到:报错日志:找不到“checkresult//routine”的路径原因:linux一般不支持双斜杠的//的路径2020-11-27 21:56:51 | ERROR | http-nio-4251-exec-6 | TemplateEngine.java:1136 | org.thymeleaf.TemplateEngine | [THYMELEAF][http-nio-4251-exec-6] Exc原创 2020-11-27 22:55:44 · 1872 阅读 · 0 评论 -
Requested bean is currently in creation: Is there an unresolvab circular reference?
关于Feign的一个bug,A服务的拦截器调用B服务,A服务启动时报bugorg.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'springApplicationAdminRegistrar': Singleton bean creation not allowed while singletons of this factory are in destructio原创 2020-11-25 19:17:51 · 2022 阅读 · 8 评论