3

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?

Vy Do
  • 46,709
  • 59
  • 215
  • 313
try_harder
  • 49
  • 1
  • 3
  • 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. – Doradus Mar 30 '22 at 00:41

0 Answers0