码迷,mamicode.com
首页 > 移动开发 > 详细

com.fasterxml.jackson.databind.JsonMappingException

时间:2017-08-03 13:49:06      阅读:433      评论:0      收藏:0      [点我收藏+]

标签:failed   epo   bin   tab   generate   nec   排查   type   nio   

问题描述:在对订单进行上传的时候,其实就是一个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 

 

com.fasterxml.jackson.databind.JsonMappingException

标签:failed   epo   bin   tab   generate   nec   排查   type   nio   

原文地址:http://www.cnblogs.com/xiaotiao-coder/p/7279102.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!