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


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

 

  

转载于:https://www.cnblogs.com/xueluozhangxin/p/8711155.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值