bukkit-runtime icon indicating copy to clipboard operation
bukkit-runtime copied to clipboard

Error when running /reload

Open connerdouglass opened this issue 4 years ago • 0 comments

The /reload builtin command doesn't work with CustomRealms plugins. The reason is complicated, but known:

  • When onLoad is called, CustomRealms plugins load the J2V8 dynamic library (native DLL/dylib bundled in the JAR file)
  • When /reload is run and the plugin is disabled, the library is not released because the ClassLoader has not been released for some reason
  • When onLoad is called during the reload process, CustomRealms tries to load the J2V8 library again. However, because it has already been loaded by a ClassLoader to which the plugin has no reference, it throws an exception

We need to find a way to properly release and initialize the J2V8 runtime without leaking resources.

The bug also might lead to errors when running multiple CustomRealms plugins in the same server, but it needs to be tested.

connerdouglass avatar Nov 14 '21 04:11 connerdouglass