最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

What's the right way to exclude some packages for spring-boot devtools restart - Stack Overflow

programmeradmin2浏览0评论

I am using spring-boot 3.4.3 with devtools automatic restart enabled.

but it causing me trouble, as devtools using RestartClassLoader to load some class, mybatis use class instance as map key to identify mappers.

public <T> T getMapper(Class<T> type, SqlSession sqlSession) {
    final MapperProxyFactory<T> mapperProxyFactory = (MapperProxyFactory<T>) knownMappers.get(type);
    if (mapperProxyFactory == null) {
      throw new BindingException("Type " + type + " is not known to the MapperRegistry.");
    }
    try {
      return mapperProxyFactory.newInstance(sqlSession);
    } catch (Exception e) {
      throw new BindingException("Error getting mapper instance. Cause: " + e, e);
    }
  }

I want to exclude .itps.pub.mappers package from RestartClassLoader ?

what's the right syntax in spring-devtools.properties, the spring-boot official doc is not telling how to exclude packages.. and googling on internet only can found examples for old versions that using wildcards.

发布评论

评论列表(0)

  1. 暂无评论