I am getting this NoClassDefFoundError in one of my programs:
10:26:56,893 ERROR [STDERR] Exception in thread "Timer-4"
10:26:56,893 ERROR [STDERR] java.lang.NoClassDefFoundError: Could not initialize class
com.something.plugin.gameserver.common.MetricsRegistrar
10:26:56,893 ERROR [STDERR] at com.something.plugin.gameserver.main.GameServerPlugin.init(GameServerPlugin.java:48)
I know its a class path issue but strangely the GameServerPlugin class where the error occurs and the MetricsRegistrar class its looking for are in the same jar. So one can’t be in the class path and the other not right?
I inspected the Jar file it has the class file in question so that not an issue either.
The INDEX.LIST of the jar also has an entry for the package of the MetricsRegistrar class. What else should I check?
For completeness I am building using Ant and running in JBoss.
Are you doing something during the class initialization of MetricsRegistrar? Like code inside
Here someone had a NoClassDefError too because of this issue.