-
Notifications
You must be signed in to change notification settings - Fork 25
/reload not working as expected #13
Comments
My guess is that the classloader is not properly restored at the @Override
public void onDisable() {
try {
if (context != null) {
context.close();
}
} finally {
context = null;
Thread.currentThread().setContextClassLoader(defaultClassLoader);
}
} Can you verify this? If this is not the case, you can also restore the default classloader right after the application startup: @Override
public void onEnable() {
try {
// app startup
} finally {
Thread.currentThread().setContextClassLoader(defaultClassLoader);
}
} The bukkit plugin reloading system is a mystery, so it's hard to deduce the problem. |
My code looks the same, except for the try/finally usage, but that should only matter if an exception is actually thrown durind the on disable. The only difference is that I change the class loader before starting the spring application, because it needs to be set before feign is initialized |
I still don't know what the cause of this problem, maybe something caused by the classloader, but no clue about exactly what it is. Can you reproduce the problem without the feign client? |
I'll try that once I have time |
Have you tried look into certain beans that get their |
Can you reproduce this bug in the latest version with It now starts the spring context in a different thread, without having to change the context class loader of the main one, this can solve other problems too. |
I might have accidentally fixed this by using a compound classloader. I need to test this a bit further, because there are other issues during the restart (my database lockfile is causing problems, see CC007/HeadsPluginAPI#8). If I'm still experiencing issues with restart after fixing those, I'll give the SpringSpigotBootstrapper a try. |
When I start the server, the plugin loads fine (now that the classloaders and shading is fixed), but when using
/reload
I get the following exceptions:The text was updated successfully, but these errors were encountered: