码迷,mamicode.com
首页 > 编程语言 > 详细

[已解决]springBoot 中添加 dev-tools后,运行程序报错Unenhance strategy

时间:2018-04-03 22:01:47      阅读:381      评论:0      收藏:0      [点我收藏+]

标签:and   collect   body   resources   types   stack   pen   art   spring   


发生条件:
在pom.xml中增加dev-tools的依赖,程序启动后,调用程序接口报错

问题现象:
-------------------------------------------------------------
Registered concrete types: 5 (approximate size: 630.7 kB)
  [interface java.util.Collection] : ArrayList<Object>
  [interface java.util.Map] : LinkedHashMap<Object, Object>
  [interface java.util.Map$Entry] : MapEntry<Object, Object>
  [interface java.util.Set] : LinkedHashSet<Object>
  [interface java.util.List] : ArrayList<Object>
-------------------------------------------------------------
Resolved strategies: 1 (approximate size: 42,825.6 kB)
{source: AppOrganization, dest: AppOrganizationDTO, in-place:false}: InstantiateAndUseCustomMapperStrategy<AppOrganization, AppOrganizationDTO> {customMapper: ma.glasnost.orika.impl.ReversedMapper@217ff750, unenhancer: ma.glasnost.orika.unenhance.BaseUnenhancer@4203fb3, objectFactory: DefaultConstructorObjectFactory<AppOrganizationDTO>}
-------------------------------------------------------------
Unenhance strategy: ma.glasnost.orika.unenhance.BaseUnenhancer@4203fb3
-----end dump of current state-------------------------------
    at ma.glasnost.orika.impl.ExceptionUtility.newMappingException(ExceptionUtility.java:55)
    at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:752)
    at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:721)

问题原因:
貌似是orika的bug

解决方案:
(参考https://stackoverflow.com/questions/33324944/orika-classcastexception-in-spring-boot-webapp):
  1. Create a META-INF folder in src/main/resources.
  2. Create spring-devtools.properties file in it.
  3. Add restart.include.orika=/orika-core.*\.jar to the file.

 

  

[已解决]springBoot 中添加 dev-tools后,运行程序报错Unenhance strategy

标签:and   collect   body   resources   types   stack   pen   art   spring   

原文地址:https://www.cnblogs.com/xueluozhangxin/p/8711155.html

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