标签:ESS mapper gsl 引用 排查 位置 get 异常 exception
springboot中引入了Dozer映射,在映射时抛出异常
java.lang.NullPointerException
at org.dozer.classmap.ClassMap.getSrcClassToMap(ClassMap.java:191)
at org.dozer.loader.MappingsParser.processMappings(MappingsParser.java:80)
at org.dozer.loader.CustomMappingsLoader.load(CustomMappingsLoader.java:49)
at org.dozer.DozerBeanMapper.loadCustomMappings(DozerBeanMapper.java:213)
at org.dozer.DozerBeanMapper.initMappings(DozerBeanMapper.java:315)
at org.dozer.DozerBeanMapper.getMappingProcessor(DozerBeanMapper.java:192)
at org.dozer.DozerBeanMapper.map(DozerBeanMapper.java:120)
at com.zx.wdrs.dozer.DozerBeanMapperTest.testMapper(DozerBeanMapperTest.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
背景:
包检查 check
打印引用的mapper 有内存地址不为空 check
@Configuration配置检查 check
配置文件位置正确 check
且打印出了加载log,说明配置已正确引入。
写Test类,剥离其他相关,简单映射下两个类,new出来的mapper可以映射,但是通过app注解绑定的还是继续抛空指针
排查堆栈信息,跟源码
getMappingProcessor
initMappings
有可能在加载个性配置时有问题。
确定注释掉了内容,但是没有注释掉mapping标签,即标签内的内容为空,导致报错,注掉mapping后正常。
标签:ESS mapper gsl 引用 排查 位置 get 异常 exception
原文地址:https://www.cnblogs.com/redqueen/p/12512509.html