![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
寄草
这个作者很懒,什么都没留下…
展开
-
Gson 测试环境 date转换抛异常
我想把前端传的map转成需要的bean时,懒省劲,先把map转为json,再从json直接转成bean。本地环境没有问题,到了测试环境就抛异常:Failed to parse date[]: Invalid time zone indicator。一开始以为是gson的版本问题,发现pom文件里的gson是2.8.7,但是打包出来是2.8.5。这个其实是因为springboot也有引用gson,版本覆盖了。后来在一篇博客里找到了答案(链接在下面),原来是不同环境获取到的SimpleDateForma原创 2021-10-27 14:39:51 · 865 阅读 · 0 评论 -
依赖冲突的查询方法
今天引入sm3算法的时候发现了这个异常:Exception in thread "main" java.lang.SecurityException: class "org.bouncycastle.crypto.digests.GeneralDigest"'s signer information does not match signer information of other classes in the same package面向浏览器,初步确诊为maven引用冲突。在stackover原创 2021-09-23 14:01:36 · 1204 阅读 · 0 评论 -
无法从静态上下文中引用非静态
public class Num{ int i = 2; void change(){ i = 3; } public static void main(String[] args){ //静态方法 Num num = new Num(); num.change(); System.out.println(i); //出现错误,因为i未实例化 }}public clas原创 2018-01-18 13:34:23 · 683 阅读 · 0 评论