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.