junit4进行单测的时候
Objects.requireNonNull(BeanUtil.copy(template, Template.class))
报异常。堆栈如下:
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "cause" is null
at org.springframework.cglib.core.CodeGenerationException.
at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:567)
at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108)
at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134)
at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319)
at org.springblade.core.tool.beans.BladeBeanCopier$Generator.create(BladeBeanCopier.java:138)
at org.springblade.core.tool.beans.BladeBeanCopier.lambda$create$0(BladeBeanCopier.java:79)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.springblade.core.tool.beans.BladeBeanCopier.create(BladeBeanCopier.java:73)
at org.springblade.core.tool.beans.BladeBeanCopier.create(BladeBeanCopier.java:67)
at org.springblade.core.tool.utils.BeanUtil.copy(BeanUtil.java:154)
at org.springblade.core.tool.utils.BeanUtil.copy(BeanUtil.java:133)
扫一扫访问 Blade技术社区 移动端