首页 > 编程语言 > 详细

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

时间:2018-04-03 21:40:46      阅读:270      评论:0      收藏:0      [点我收藏+]

发生条件:
在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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!