spring-boot - Spring Boot DevTools - RestartClassLoader 问题
问题描述
使用 spring boot 开发工具库时,类加载器会出现一些问题,主要是:
问题是专用类有两个类加载器。当从 memcache 加载类并将类映射/转换到类对象时,会出现类似的异常
java.lang.ClassCastException: class xxx.api.cache.CachedResponse cannot be cast to class xxx.api.cache.CachedResponse (xxx.api.cache.CachedResponse is in unnamed module of loader 'app'; xxx.api.cache.CachedResponse is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @2f6f8549)
我试图CachedResponse
从重新启动或某些方式中排除课程,RestartClassLoader
但我没有成功。我用过
restart.exclude.classes=file:/app/build/classes/java/main/
属性,但它排除了类路径中的所有分类。我试图排除特定类CachedResponse
但没有结果。我也尝试将 folsom jar 包括在内,RestartClassLoader
但没有奏效。
是否有可能将该CachedResponse
类排除在外RestartClassLoader
?
解决方案
推荐阅读
- html - Cargocollective 图像库基线的 CSS 方法
- python - 提高列作为 Pandas 的力量
- mongodb - `{id: 1, title: "text"}` 和 {title: "text", id: 1} MongoDB 索引之间的区别
- c - Logrotate 可以在 C 语言中使用吗?
- robotframework - 定义全局测试设置
- java - 在单列中显示地址,而不是在自己的列中显示每一行地址
- java - 所需的输出是假,真,假,真。我的结果是错误的,真实的,真实的,真实的。我的代码中是否缺少某些内容?
- android - JetpackCompose Modifier 属性的 aspectRatio(1f) 和 fillMaxSize() 有什么区别
- azure - Azure 应用服务 - 三个可用区中的实例
- docker - 如何在带有许多引号的 Windows Docker 容器中执行 WMI 查询?