wiki:NoClassDefFoundError
Last modified 5 years ago Last modified on Dec 8, 2006 8:47:16 AM

NoClassDefFoundError


Exemple

Here is an exemple of NoClassDefFoundError:

error handling client message [C] 0B CharacterCreate? java.lang.NoClassDefFoundError?: Could not initialize class net.sf.l2j.gameserver.model.actor.instance.L2PcInstance
    at net.sf.l2j.gameserver.clientpackets.CharacterCreate?.runImpl(CharacterCreate.java:136)
    at net.sf.l2j.gameserver.clientpackets.ClientBasePacket?.run(ClientBasePacket.java:59)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)


Explanation

This means that java didn't find the correct class to instanciate an object.
So either :

  • you didn't include the correct folders in the classpath.
  • you didn't build your project correctly.


Resolution

Most of the NoClassDefFoundError are linked with a corrupted build of the project so :

  • If you are using eclipse, use Project -> Clean... to first delete all the compiled class and then rebuild all those files.
  • If not, then delete the "build" folder and compile the java file again.

Then you only have to rebuild the server and override your files.



Have fun!