Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

java.lang.ExceptionInInitializerError #15

Closed
GabrielAtlas opened this issue Jul 6, 2021 · 4 comments
Closed

java.lang.ExceptionInInitializerError #15

GabrielAtlas opened this issue Jul 6, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@GabrielAtlas
Copy link

Why?

Error log: https://pastebin.com/tJ2NvfhB

My code:

private boolean isValidParticle(String particle) {
		try {
			ParticleEffect.valueOf(particle);
			return true;
		} catch (Exception e) {
			return false;
		}
}
@ByteZ1337
Copy link
Owner

Do you use a custom ClassLoader by any chance?

@GabrielAtlas
Copy link
Author

Yeah, i have a custom class loader running my plugins

@ByteZ1337
Copy link
Owner

Well, that is the issue here. I'm using the plugin field in the PluginClassLoader to retrieve the plugin, that belongs to ParticleLib. This plugin instance is needed to register Listeners and start tasks.

I might add a setter for the plugin in the future, but in the meantime, you have to load the ReflectionUtils class with the normal Bukkit ClassLoader. To do that, just add a simple method call that does nothing (like ReflectionUtils.existsClass("");) to your onEnable method. Let me know if that fixes your issue for now.

@ByteZ1337
Copy link
Owner

You can now set the ReflectionUtils#plugin field in 1.6.4.

@ByteZ1337 ByteZ1337 added the bug Something isn't working label Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants