Spring Boot DevTools - RestartClassLoader problem
Asked Answered
E

0

7

When using the spring boot dev tools library the are some problems with class loaders, mainly: enter image description here

The problem is that there are two class loaders for dedicated class. When load the class from memcache and map/cast to object of class there is an exception like

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)

I have tried to exclude CachedResponse class from restart or some how from RestartClassLoader but I did not manage to me. I have used

restart.exclude.classes=file:/app/build/classes/java/main/

property but it exclude all classed in classpath. I have tried to exclude specific class CachedResponse but no results. Also I have tried to include the folsom jar to RestartClassLoader but did not work.

Is there a possibility to exclude that CachedResponse class from RestartClassLoader?

Electrode answered 16/11, 2021 at 13:28 Comment(1)
I've seen this tool. I've disabled dev tools for now, but I'd love for my app to be compatible with dev tools.Panslavism

© 2022 - 2024 — McMap. All rights reserved.