博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
com.fasterxml.jackson.databind.JsonMappingException
阅读量:5181 次
发布时间:2019-06-13

本文共 4027 字,大约阅读时间需要 13 分钟。

问题描述:在对订单进行上传的时候,其实就是一个excel文件,发现controller对业务层代码调用老是出问题,排查原因时发现原来时被同事的AOP给拦截了,用JackSon对流进行打印导致的异常。

 

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Failed to load class 'sun.nio.ch.FileChannelImpl$Access4JacksonSerializer0370ba83': com.fasterxml.jackson.module.afterburner.ser.BeanPropertyAccessor (through reference chain: java.io.FileInputStream["channel"])

at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:291)
at com.fasterxml.jackson.databind.SerializerProvider.mappingException(SerializerProvider.java:1124)
at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1146)
at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1263)
at com.fasterxml.jackson.databind.SerializerProvider.findPrimaryPropertySerializer(SerializerProvider.java:653)
at com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap.findAndAddPrimarySerializer(PropertySerializerMap.java:64)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter._findAndAddDynamic(BeanPropertyWriter.java:874)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:682)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:690)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:292)
at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3681)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3057)
at com.wormpex.common.json.JsonMapper.writeValueAsString(JsonMapper.java:1029)
... 24 more
Caused by: java.lang.IllegalArgumentException: Failed to load class 'sun.nio.ch.FileChannelImpl$Access4JacksonSerializer0370ba83': com.fasterxml.jackson.module.afterburner.ser.BeanPropertyAccessor
at com.fasterxml.jackson.module.afterburner.util.MyClassLoader.loadAndResolve(MyClassLoader.java:100)
at com.fasterxml.jackson.module.afterburner.ser.PropertyAccessorCollector.generateAccessorClass(PropertyAccessorCollector.java:171)
at com.fasterxml.jackson.module.afterburner.ser.PropertyAccessorCollector.findAccessor(PropertyAccessorCollector.java:97)
at com.fasterxml.jackson.module.afterburner.ser.SerializerModifier.changeProperties(SerializerModifier.java:63)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.constructBeanSerializer(BeanSerializerFactory.java:412)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanSerializer(BeanSerializerFactory.java:282)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:234)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:168)
at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1308)
at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1258)
... 34 more
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.module.afterburner.ser.BeanPropertyAccessor
at java.lang.ClassLoader.findClass(ClassLoader.java:530)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at com.fasterxml.jackson.module.afterburner.util.MyClassLoader.loadAndResolve(MyClassLoader.java:94)
... 43 more

 

解决方法:

  这段诡异的异常信息浪费了我一下午的时间,还是跟踪调用栈靠谱,以下是跟踪栈发现的信息:

[org.springframework.aop.interceptor.ExposeInvocationInterceptor.ADVISOR, InstantiationModelAwarePointcutAdvisor: expression [execution(* com..xxx.xxx.xxx.xxx.biz..impl.*.*(..))]; advice method 

 

转载于:https://www.cnblogs.com/xiaotiao-coder/p/7279102.html

你可能感兴趣的文章
使用Zabbix通过ILO管理口监控惠普服务器
查看>>
Window10
查看>>
2.4删除单链表L中一个最小值结点的高校算法(假设最小值结点是唯一的)
查看>>
HTML/CSS
查看>>
42.利用数组_计算天数
查看>>
Python-Redis
查看>>
iOS 基础知识
查看>>
Kubernetes学习系列
查看>>
代理模式
查看>>
Luogu P1495 曹冲养猪
查看>>
java--全文检索框架--Lucene
查看>>
博客转发小工具1
查看>>
easyui 根据值查找匹配
查看>>
SpringMVC入门(二)—— 参数的传递、Controller方法返回值、json数据交互、异常处理、图片上传、拦截器...
查看>>
git的安装
查看>>
mysql 8.0 zip包安装
查看>>
Spring框架系列(三)--Bean的作用域和生命周期
查看>>
springboot + mybatis
查看>>
awk 统计
查看>>
CSS min-height 属性
查看>>