Skip to content
Advertisement

Tag: urlclassloader

java.lang.ClassNotFoundException when trying to load derived class

I have two different Modules: MultiRealm and SurvivalRealm. MultiRealm provides an abstract class (LoadedRealm) which the class SurvivalRealm (in the Module SurvivalRealm) extends. Now, MultiRealm tries to load the SurvivalRealm class from the jar. But when trying to load, i get the Following error: java.lang.NoClassDefFoundError: net/lightbluefoxlabs/dev/multirealm/core/multirealmcore/Realms/LoadedRealm where net/lightbluefoxlabs/dev/multirealm/core/multirealmcore/Realms/LoadedRealm is the correct location of the LoadedRealm class. Here is the Stacktrace:

Keep getting NoClassDefFoundError while loading a class with URLClassLoader

Recently I’m creating something that have to load/unload external jar packages dynamically. I’m now trying to do this with URLClassLoader, but I keep getting NoClassDefFoundError while trying to make new instances. It seems that the external class is loaded successfully since the codes in the constructor are executed, but ClassNotFoundException and NoClassDefFoundError still keep being thrown. I made an small

Advertisement