redis反序列化出现:java.lang.ClassNotFoundException异常
问题诱因
导致java.lang.ClassNotFoundException问题有:
序列化和反序列化的serialVersionUID不一致。
反序列的对象和反序列化的对象所属的包名不一致。
解决方法
https://blog.csdn.net/linzhiqiang0316/article/details/102692424
linux环境下,jar包位置,以及jar包内文件和jar包外文件位置
解决方法
https://www.cnblogs.com/zeciiii/p/4178824.html
java.net.SocketException: Unexpected end of file from server
意思就是说“意外的文件结束”意味着远程服务器接受并关闭连接,而不发送响应。远程系统可能太忙,无法处理请求,或者有网络错误随机丢弃连接。
解决方法
https://blog.csdn.net/chenz_yang/article/details/77238532
类似于无权限,或者没开放外网等等无法访问地址、文件的问题
java.util.ConcurrentModificationException: null
类似于
for (TmPositionJob o : lists){
if (“终止”.equalsIgnoreCase(o.getOperName())){
lists.remove(o);
}
}
简单描述情况就是:小生对size只有1的集合做了删除导致了该size发生了变化从而报错。
强循环的删除对只有1size的集合会造成异常
解决方法:使用迭代器
解决方法
https://blog.csdn.net/SELECT_BIN/article/details/83820561
@JsonFormat & @DateTimeFormat 前后台交互 时间戳转为年月日时
1.@JsonFormat(pattern=“yyyy-MM-dd HH:mm:ss”,timezone = “GMT+8”)
pattern:需要转换的时间日期的格式
timezone:是时间设置为东八区
2.@DateTimeFormat(pattern = “yyyy-MM-dd HH:mm:ss”)
pattern:需要转换的时间日期的格式
3.例子
/俩个注解可以同时使用/
@ApiModelProperty(“创建时间”)
@JsonFormat(pattern=“yyyy-MM-dd HH:mm:ss”,timezone = “GMT+8”)
@DateTimeFormat(pattern = “yyyy-MM-dd HH:mm:ss”)
private Date createdDate ;
LocalDate计算两个日期间距离
LocalDate start = LocalDate.parse(“2018-08-28”);
LocalDate end = LocalDate.parse(“2018-09-30”);
long year = start.until(end, ChronoUnit.YEARS);
long month = start.until(end, ChronoUnit.MONTHS);
long days = start.until(end, ChronoUnit.DAYS);
System.out.println(“间隔:” + year + “年”);
System.out.println(“间隔:” + month + “月”);
System.out.println(“间隔:” + days + “天”);
参考:https://blog.csdn.net/zls_1029/article/details/82930583
== Caused by: io.lettuce.core.RedisCommandExecutionException: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Com ==
这个问题出现的原因是我linux的redis在启动的时候我强制把这个目录移去别的地方,好像是因为没有可写盘的权限,问题目前还不是特别明白。
本人未解决该问题,只能通过重装redis得到解决。
别的解决办法,或许有帮助:
https://www.jianshu.com/p/9d281d1390f2
如何解决SVN Commit failed (details follow): Access denied
通常问题是没有update就commit,但是我的问题很奇怪,是idea抽风了,只能去到windows的.svn文件夹同级的project下用客户端svn来commit才可以成功,之后idea那里的svn插件就突然好了。
@Value注入static属性
一般@Value是使用在非静态方法上的
小生用的是第三种方法解决的
方法三:通过中间变量赋值
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class Test {
public static String url = “/dev/xx”;
@Value("${url}")
public String tempUrl = "/dev/xx";
@PostConstruct
public void init() {
url = tempUrl;
}
}
解决办法:http://www.mamicode.com/info-detail-2769122.html
java.lang.IllegalArgumentException: argument type mismatch
我这边因为建表的时候,主键没有使用自动增长,之后生成实体类时疏忽未加上@TableId(type = IdType.AUTO)导致
解决方案:https://blog.csdn.net/weixin_41492426/article/details/105348083
sql可以查出数据,但是在springboot框架里用@Select注解却无法查出数据
原因:
mapper不支持方法重载
使用log-impl: org.apache.ibatis.logging.stdout.StdOutImpl(mybatic-plus)
打印sql,发现,与其他方法重载,导致映射有问题
解决办法:修改方法名咯~~