Jump to content

[unsolved]Installing mod gives java.lang.NoClassDefFoundError


Recommended Posts

Posted

My mod works fine in MPC but when i try to install it gives me this error:

 Minecraft has crashed!      
      ----------------------      

Minecraft has stopped running because it encountered a problem; Failed to start game

A full error report has been saved to C:\Users\Oscar\AppData\Roaming\.minecraft\crash-reports\crash-2013-03-30_14.34.53-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash 



--- BEGIN ERROR REPORT c9559978 --------
Full report at:
C:\Users\Oscar\AppData\Roaming\.minecraft\crash-reports\crash-2013-03-30_14.34.53-client.txt
Please show that file to Mojang, NOT just this screen!

Generated 2013-03-30 14:34

-- System Details --
Details:
Minecraft Version: 1.5.1
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.6.0_30, Sun Microsystems Inc.
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
Memory: 566960936 bytes (540 MB) / 648740864 bytes (618 MB) up to 954466304 bytes (910 MB)
JVM Flags: 2 total; -Xms512m -Xmx1024m
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
CastleDef [Castle Defenders] (CastleDef (2).zip) Unloaded->Constructed->Pre-initialized->Errored
LWJGL: 2.4.2
OpenGL: GeForce GTX 470/PCIe/SSE2 GL version 4.2.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'forge,fml'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: mods/CastleDef/Azurn/EntityKnight
at cpw.mods.fml.common.LoadController.transition(LoadController.java:142)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:444)
at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
at net.minecraft.client.Minecraft.run(Minecraft.java:729)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: mods/CastleDef/Azurn/EntityKnight
at mods.CastleDef.client.ClientProxyCastleDef.registerRenderThings(ClientProxyCastleDef.java:20)
at mods.CastleDef.Azurn.mod_castledef.load(mod_castledef.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)
... 5 more
Caused by: java.lang.ClassNotFoundException: mods.CastleDef.Azurn.EntityKnight
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:211)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 33 more
Caused by: java.lang.NoClassDefFoundError: mods/CastleDef/Azurn/EntityDefender
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:200)
... 35 more
Caused by: java.lang.ClassNotFoundException: mods.CastleDef.Azurn.EntityDefender
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:113)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 40 more
--- END ERROR REPORT c5bacae ----------

 

My folder setup looks like this:

mods/Castledef.zip/mods/CastleDef/Azurn/EntityKnight.class(and other .class files)

mods/Castledef.zip/mods/CastleDef/common

mods/Castledef.zip/mods/CastleDef/client

mods/Castledef.zip/mods/textures/blocks

mods/Castledef.zip/mods/textures/items

 

I would appreciate some help. Thanks!

Posted

Yes, it is in mods/Castledef.zip/mods/CastleDef/Azurn

 

Here is the code:

 

package mods.CastleDef.Azurn;



import java.util.Map;

import javax.crypto.Mac;

import mods.CastleDef.common.CommonProxyCastleDef;

import net.minecraft.block.Block;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="CastleDef", name ="Castle Defenders",version="1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)



public class mod_castledef 
{

//public static final String modid = "Castle Defenders";

public static Block BlockKnight;
public static Block BlockArcher;
public static Block BlockMerc;
public static Block BlockEKnight;
public static Block BlockEArcher;
public static Block BlockMage;
public static Block BlockEMage;

public static Item ItemMedallion;

public static int defenderID;
public static int knightID;
public static int archerID;
public static int mercID;
public static int EknightID ;
public static int EarcherID;	
public static int mageID = -17;
public static int EmageID = -18;

public static int BlockKnightID;
public static int BlockArcherID;
public static int BlockMercID;
public static int BlockEKnightID;
public static int BlockEArcherID;
public static int BlockMageID;
public static int BlockEMageID;

public static int MedallionID;

public static int CastleSpawnRaste;
public static int MercSpawnRate;

@SidedProxy(clientSide="mods.CastleDef.client.ClientProxyCastleDef", serverSide = "mods.CastleDef.common.CommonProxyCastleDef")
public static CommonProxyCastleDef proxy;

@PreInit
public void PreLoad(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());

config.load();

BlockKnightID = config.get("BlockKnightID", Configuration.CATEGORY_BLOCK, 238).getInt();
BlockArcherID = config.get("BlockArcherID", Configuration.CATEGORY_BLOCK, 239).getInt();
BlockMercID = config.get("BlockMercID", Configuration.CATEGORY_BLOCK, 234).getInt();
BlockEKnightID = config.get("BlockEKnightID", Configuration.CATEGORY_BLOCK, 237).getInt();
BlockEArcherID = config.get("BlockEArcherID", Configuration.CATEGORY_BLOCK, 236).getInt();
BlockMageID = config.get("BlockMageID", Configuration.CATEGORY_BLOCK, 235).getInt();
BlockEMageID = config.get("BlockEMageID", Configuration.CATEGORY_BLOCK, 233).getInt();

MedallionID = config.get("MedallionID", Configuration.CATEGORY_ITEM, 3001).getInt();


defenderID = config.get("defenderID", Configuration.CATEGORY_GENERAL, -11).getInt();
knightID = config.get("knightID", Configuration.CATEGORY_GENERAL, -12).getInt();
archerID = config.get("archerID", Configuration.CATEGORY_GENERAL, -13).getInt();
mercID = config.get("mercID", Configuration.CATEGORY_GENERAL, -14).getInt();
EknightID = config.get("EknightID", Configuration.CATEGORY_GENERAL, -15).getInt();
EarcherID= config.get("EarcherID", Configuration.CATEGORY_GENERAL, -16).getInt();
EmageID = config.get("EmageID", Configuration.CATEGORY_GENERAL, -17).getInt();
mageID= config.get("mageID", Configuration.CATEGORY_GENERAL, -18).getInt();

CastleSpawnRaste = config.get("CastleSpawnRaste", Configuration.CATEGORY_GENERAL, 4).getInt();
MercSpawnRate = config.get("MercSpawnRate", Configuration.CATEGORY_GENERAL, 4).getInt();
config.save();
}


static int startEntityId = 300;


@Init
public void load(FMLInitializationEvent event)
{
  proxy.registerRenderThings();
  
  ItemMedallion=(new ItemMedallion(MedallionID)).setUnlocalizedName("Medallion");
  LanguageRegistry.addName(ItemMedallion, "Medallion");
  
  
  
  BlockKnight=(new BlockKnight(BlockKnightID)).setUnlocalizedName("BlockKnight").setHardness(2F).setResistance(5F);
  GameRegistry.registerBlock(BlockKnight);
  LanguageRegistry.addName(BlockKnight,"Knight Spawner"); 
  GameRegistry.registerTileEntity(TileEntityBlockKnight.class, "Knight Block");
  
  BlockArcher=(new BlockArcher(BlockArcherID)).setUnlocalizedName("BlockArcher").setHardness(2F).setResistance(5F);
  GameRegistry.registerBlock(BlockArcher);
  LanguageRegistry.addName(BlockArcher,"Archer Spawner"); 
  GameRegistry.registerTileEntity(TileEntityBlockArcher.class, "BlockArcher");
  
  BlockMerc=(new BlockMerc(BlockMercID)).setUnlocalizedName("BlockMerc").setHardness(2F).setResistance(5F);
  GameRegistry.registerBlock(BlockMerc);
LanguageRegistry.addName(BlockMerc, "Merc Spawner");
GameRegistry.registerTileEntity(TileEntityBlockMerc.class, "Merc Block");

BlockEKnight=(new BlockEKnight(BlockEKnightID)).setUnlocalizedName("BlockEKnight").setHardness(2F).setResistance(5F);
GameRegistry.registerBlock(BlockEKnight);
LanguageRegistry.addName(BlockEKnight,"Enemy Knight Spawner"); 
GameRegistry.registerTileEntity(TileEntityBlockEKnight.class, "Enemy Knight Block");

BlockEArcher=(new BlockEArcher(BlockEArcherID)).setUnlocalizedName("BlockEArcher").setHardness(2F).setResistance(5F);
GameRegistry.registerBlock(BlockEArcher);
LanguageRegistry.addName(BlockEArcher, "Enemy Archer Spawner");
GameRegistry.registerTileEntity(TileEntityBlockEArcher.class, "Enemy Archer Block");

BlockMage=(new BlockMage(BlockMageID)).setUnlocalizedName("BlockMage").setHardness(2F).setResistance(5F);
GameRegistry.registerBlock(BlockMage);
LanguageRegistry.addName(BlockMage, "Mage Spawner");
GameRegistry.registerTileEntity(TileEntityBlockEArcher.class, "Mage Block");

BlockEMage=(new BlockEMage(BlockEMageID)).setUnlocalizedName("BlockEMage").setHardness(2F).setResistance(5F);
GameRegistry.registerBlock(BlockEMage);
LanguageRegistry.addName(BlockEMage, "Enemy Mage Spawner");
GameRegistry.registerTileEntity(TileEntityBlockEArcher.class, "Enemy Mage Block");


  	GameRegistry.addRecipe(new ItemStack(BlockKnight,1), new Object [] {
  	" X ","XYX"," X ", Character.valueOf('X'), Item.ingotIron,Character.valueOf('Y'), Item.swordSteel
});
GameRegistry.addRecipe(new ItemStack(BlockArcher,1), new Object [] {
" X ","XYX"," X ", Character.valueOf('X'), Item.ingotIron,Character.valueOf('Y'), Item.bow
});

GameRegistry.addRecipe(new ItemStack(BlockMage,1), new Object [] {
	"   "," X "," Y ", Character.valueOf('X'), mod_castledef.ItemMedallion ,Character.valueOf('Y'), mod_castledef.BlockEMage
	});


  EntityRegistry.registerGlobalEntityID(EntityDefender.class, "Defender", defenderID);

  EntityRegistry.registerGlobalEntityID(EntityKnight.class, "Knight", knightID);
  EntityRegistry.addSpawn(EntityKnight.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  LanguageRegistry.instance().addStringLocalization("entity.Castle Defenders.Knight.name", "Knight");
  registerEntityEgg(EntityKnight.class, 0xffffff, 0x000000);
  
  EntityRegistry.registerGlobalEntityID(EntityArcher.class, "Archer", archerID);
  EntityRegistry.addSpawn(EntityArcher.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  LanguageRegistry.instance().addStringLocalization("entity.Castle Defenders.Archer.name", "Archer");
  registerEntityEgg(EntityArcher.class, 0xffffff, 0x500000);
  
  EntityRegistry.registerGlobalEntityID(EntityMerc.class, "Merc", mercID);
  EntityRegistry.addSpawn(EntityMerc.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  registerEntityEgg(EntityMerc.class, 0xffffff, 0x603400);
  
  
  EntityRegistry.registerGlobalEntityID(EntityMage.class, "Mage", mageID);
  registerEntityEgg(EntityMage.class, 0xffffff, 0x003460);
  
  EntityRegistry.registerGlobalEntityID(EntityEMage.class, "Enemy Mage", EmageID);
  registerEntityEgg(EntityEMage.class, 0xffffff, 0x903400);
  
  EntityRegistry.registerGlobalEntityID(EntityEKnight.class, "Enemy Knight", EknightID);
  EntityRegistry.addSpawn(EntityEKnight.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  registerEntityEgg(EntityEKnight.class, 0xffffff, 0x009060);
  
  
  EntityRegistry.registerGlobalEntityID(EntityEArcher.class, "Enemy Archer", EarcherID);
  EntityRegistry.addSpawn(EntityEArcher.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  registerEntityEgg(EntityEArcher.class, 0xffffff, 0x759060);
  
  
  GameRegistry.registerWorldGenerator(new WorldGeneratorMercbase());
  GameRegistry.registerWorldGenerator(new WorldGeneratorCastle());
  
  
}
public static int getUniqueEntityId() 
{
  do 
  {
   startEntityId++;
  } 
  while (EntityList.getStringFromID(startEntityId) != null);

   return startEntityId;
}

public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) 
{
  int id = getUniqueEntityId();
  EntityList.IDtoClassMapping.put(id, entity);
  EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}



}

Posted

I had this same error and for me the problem was different versions of forge src and forge universal. That's probably not your case but if you didn't check that you should.

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

  • 2 weeks later...
Posted

I do not think my folder structure is the problem. When i change it is says:

cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: mods.castledef.azurn.mod_castledef

instead of

java.lang.NoClassDefFoundError: mods/CastleDef/Azurn/EntityKnight

mod_castledef and entityKnight is in the same folder.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.