Skip to content

Folsom - Spring Boot DevTools class loader #188

@CallMeSweets

Description

@CallMeSweets

Hi,
When using the spring boot dev tools library the are some problems with class loaders, mainly:
Screenshot from 2021-11-16 12-57-48 (1)

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.

The question is:
Is it possible to implement functionality in folsom to use RestartClassLoader?
Or is there possibility to exclude that CachedResponse class from RestartClassLoader

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions