Jump to content

[1.7.10] cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException


Recommended Posts

Posted

Can someone please help me with this?

 

I am working on a backpack mod but when I added a KeyHandler class it gives me the error of:

 

---- Minecraft Crash Report ----
// My bad.

Time: 4/3/15 9:23 AM
Description: There was a severe problem during mod loading that has caused the game to fail

cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException:  net.magicalforge.daffierbags.proxy.ClientProxy
at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:76)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:492)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:492)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)
at net.minecraft.client.Minecraft.run(Minecraft.java:931)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.ClassNotFoundException:  net.magicalforge.daffierbags.proxy.ClientProxy
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:58)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:59)
... 40 more
Caused by: java.lang.NullPointerException
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182)
... 46 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.7.0_75, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 825921136 bytes (787 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.97.1347 Minecraft Forge 10.13.2.1347 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{7.10.97.1347} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1347-1.7.10.jar) Unloaded->Constructed
Forge{10.13.2.1347} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1347-1.7.10.jar) Unloaded->Constructed
Daffierbags{1.0} [Daffierbags] (DaffierBags3.0) Unloaded->Errored

 

 

 

I have tried everything to try fix it. My KeyHandler and ClientProxy classes is:

 

 

package net.magicalforge.daffierbags.handler;

import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import net.magicalforge.daffierbags.Main;
import net.magicalforge.daffierbags.References;
import net.magicalforge.daffierbags.packet.OpenGuiPacket;
import net.minecraft.client.gui.GuiChat;
import org.lwjgl.input.Keyboard;
import net.minecraft.client.settings.KeyBinding;

/**
* Created by benjamin on 2015-04-02.
*/
public class KeyHandler {

    public static final int BACKPACK_KEY = 0;

    private static final String[] keyDesc = {"key.daffierbags.backpack.desc"};
    private static final int[] keyValues = {Keyboard.KEY_B};
    private final KeyBinding[] keys;

    public KeyHandler(){
        keys = new KeyBinding[keyValues.length];
        for (int i = 0; i < keyValues.length; i++){
            keys[i] = new KeyBinding(keyDesc[i], keyValues[i], "key.daffierbags.category");
            ClientRegistry.registerKeyBinding(keys[i]);
        }
    }

    @SubscribeEvent
    public void onKeyInput(InputEvent.KeyInputEvent event){
        if(!FMLClientHandler.instance().isGUIOpen(GuiChat.class));
        int key = Keyboard.getEventKey();
        boolean isDown = Keyboard.getEventKeyState();

        //Backpack Key
        if(isDown && key == keyValues[bACKPACK_KEY]){
            //send packet to open gui
            Main.packetpipeline.sendToServer(new OpenGuiPacket(References.GUI_BACKPACK));
        }
    }
}

 

and:

 

package net.magicalforge.daffierbags.proxy;


import cpw.mods.fml.common.FMLCommonHandler;
import net.magicalforge.daffierbags.handler.KeyHandler;

public class ClientProxy extends CommonProxy{

    public void registerproxies() {
        FMLCommonHandler.instance().bus().register(new KeyHandler());
    }

}

 

 

Someone please help!

Posted
  On 4/3/2015 at 7:51 AM, laci200270 said:

Show your main class

 

package net.magicalforge.daffierbags;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import net.magicalforge.daffierbags.item.DaffierbagItems;
import net.magicalforge.daffierbags.packet.PacketPipeline;
import net.magicalforge.daffierbags.proxy.CommonProxy;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

@Mod(modid = Main.MODID, version = Main.VERSION)
public class Main
{
    public static final String MODID = "Daffierbags";
    public static final String VERSION = "1.0";

    @Mod.Instance(MODID)
    public static Main instance;

    @SidedProxy(clientSide= " net.magicalforge.daffierbags.proxy.ClientProxy", serverSide= " net.magicalforge.daffierbags.proxy.CommonProxy")
    public static CommonProxy proxy;

    public static final PacketPipeline packetpipeline = new PacketPipeline();

    public static CreativeTabs creativeTabDaffier;


    @EventHandler
    public void init(FMLInitializationEvent event){
        creativeTabDaffier = new CreativeTabs("daffierbagsTab") {
            @Override
            public Item getTabIconItem() {return DaffierbagItems.backpack;}
        };

        DaffierbagItems.loaditems();

        proxy.registerproxies();
    }

    @EventHandler
    public void postLoad(FMLPostInitializationEvent event) {
        packetpipeline.postInitialized();
    }
}

Posted

You typed a space:

  On 4/3/2015 at 7:52 AM, benjaminblue42 said:

 

    @SidedProxy(clientSide= " net.magicalforge.daffierbags.proxy.ClientProxy", serverSide= " net.magicalforge.daffierbags.proxy.CommonProxy")

   

Replace with:
@SidedProxy(clientSide= "net.magicalforge.daffierbags.proxy.ClientProxy", serverSide= "net.magicalforge.daffierbags.proxy.CommonProxy")

EDIT: deleted a space from commonproxy

Sorry for my English

Posted
  On 4/3/2015 at 7:54 AM, laci200270 said:

You typed a space:

  Quote

 

    @SidedProxy(clientSide= " net.magicalforge.daffierbags.proxy.ClientProxy", serverSide= " net.magicalforge.daffierbags.proxy.CommonProxy")

   

Replace with:
@SidedProxy(clientSide= "net.magicalforge.daffierbags.proxy.ClientProxy", serverSide= "net.magicalforge.daffierbags.proxy.CommonProxy")

EDIT deleted a space from commonproxy

 

THANKS!!!! :DDD I've been stuck on that for hours!! :D

  • 4 years later...
Posted

Please don’t Necro old threads.

If you have an issue please make your own.

also please keep this forum in English.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Managed to solve the issue myself. Solved by a fresh modpack instance.
    • Hello, so straight to the problem. Today i wanted to startup Enigmatica as usual and it just wont startup. Last night everything worked fine, i didnt even turn off my pc. Crash log: https://mclo.gs/GJ6Kcy1
    • Rubidium and Embeddium are versions of the same mod, you can only have one. I believe Embeddium is the one that's actively maintained.
    • Hello, New to modding, but have a solid CS foundation. I've created multiple custom BlockEntities that all have the same issue, which is that the inventory only updates on right click (overriding the useItemOn method). I've seen multiple posts on here outlining a similar issue to mine, but I've already implemented the solution of: overriding the correct methods in the BlockEntity class and calling setChanged(). I've tried every different place for setChanged() to no success. I'm wondering if I'm missing something else or if there was some change to sending data to the client in 1.21.5? Or will I have to use a custom packet sender? Here is the code for one of my BlockEntity classes with a single inventory slot: public class MyCustomBlockEntity extends BlockEntity { public final ItemStackHandler inventory = new ItemStackHandler(1) { @Override protected int getStackLimit(int slot, @NotNull ItemStack stack) { return 1; } @Override protected void onContentsChanged(int slot) { setChanged(); if (!level.isClientSide()) { level.setBlockAndUpdate(getBlockPos(), getBlockState()); } } }; public MyCustomBlockEntity(BlockPos pPos, BlockState pBlockState) { super(ModBlockEntities.MY_CUSTOM_BE.get(), pPos, pBlockState); } public void clearContents() { inventory.setStackInSlot(0, ItemStack.EMPTY); } public void dropItem() { SimpleContainer inv = new SimpleContainer(inventory.getSlots()); inv.setItem(0, inventory.getStackInSlot(0)); Containers.dropContents(this.level, this.worldPosition, inv); } @Override public void setRemoved() { dropItem(); super.setRemoved(); } @Override protected void saveAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { super.saveAdditional(pTag, pRegistries); pTag.put("inventory", inventory.serializeNBT(pRegistries)); } @Override protected void loadAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { super.loadAdditional(pTag, pRegistries); inventory.deserializeNBT(pRegistries, pTag.getCompound("inventory").get()); } @Override public Packet<ClientGamePacketListener> getUpdatePacket() { return ClientboundBlockEntityDataPacket.create(this); } @Override public CompoundTag getUpdateTag(HolderLookup.Provider pRegistries) { return saveWithoutMetadata(pRegistries); } } Mostly encountering the issue when calling the clearContents() method anywhere outside of useItemOn() in the Block class. I've also tried overriding both the handleUpdateTag() and onDataPacket() methods, calling their super along with loadAdditional(), but neither changed the outcome. Thanks in advance for any replies.
    • Hi all! I’m working on a Jurassic Park-themed mod for Minecraft 1.20.1, aiming to include dinosaurs, fossils, DNA extraction, and cool machines. This is a free project, mainly passion-driven, and I’ll give full credit to everyone involved. this is the perfect opportunity for beginners of modeling and coding. This project will give you experience and a creative freedom If you love dinosaurs and Minecraft modding, hit me up! Thanks! Add Me ogfrost. <--- Discord
  • Topics

×
×
  • Create New...

Important Information

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