-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Folsom - Spring Boot DevTools class loader #188
Comments
Been looking at this, but not sure how it relates to Folsom. Folsom does not have any class named CachedResponse, so that class must come from other part of the code base. Could you clarify what you mean by "load the class from memcache and map/cast to object of class"? I'm not very familiar with RestartClassLoader, but Folsom does not do anything special with respect to class loading, so should work with most regular class loaders. Also, given this, I don't think it would make much sense for Folsom to treat any specific class loader differently. |
Sorry, I did not present problem well. A little explanation: Second case: The problem: Folsom does not consider that might be another class loader and that not allow making a hot-swap of that library. I am absolutely sure that this is not a problem of Folsom because it works very well without devtools. But in such a situation the hot-swap is not possible. |
Thanks for elaborating, that's helpful. Yeah, I think this is not a problem with Folsom as such. You could investigate implementing a custom transcoder for Folsom that is aware of your classloaders, or try to make sure that Folsom is loaded in the same classloader as your class. |
Hi,

When using the spring boot dev tools library the are some problems with class loaders, mainly:
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
The text was updated successfully, but these errors were encountered: