Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] Library only working on runServer/runClient (java.lang.NoClassDefFoundError)
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
GloriousAlpaca

[1.12.2] Library only working on runServer/runClient (java.lang.NoClassDefFoundError)

By GloriousAlpaca, June 8, 2019 in Modder Support

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • Next
  • Page 2 of 2  

Recommended Posts

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019

I have found the error!
The manifest.mf is empty for some reason.

I'll change the code to what it was before.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted June 9, 2019
1 minute ago, GloriousAlpaca said:

I have found the error!
The manifest.mf is empty for some reason.

I'll change the code to what it was before.

Well, you completely removed the code that adds the Contained-Deps entry. Not sure why you did that.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019
Just now, diesieben07 said:

Well, you completely removed the code that adds the Contained-Deps entry. Not sure why you did that.

I looked at the old thread and my manifest.mf was broken too, so I put a non-broken manifest.mf in the resources folder, however it didn't copy it into the jar.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019

I again have the error:

---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 09.06.19 15:02
Description: Exception in server tick loop

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Minebot (minebot)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections4/map/CaseInsensitiveMap
	at net.dv8tion.jda.core.utils.JDALogger.<clinit>(JDALogger.java:57)
	at net.dv8tion.jda.core.entities.impl.JDAImpl.<clinit>(JDAImpl.java:65)
	at net.dv8tion.jda.core.JDABuilder.build(JDABuilder.java:890)
	at mod.minebot.discord.DISCORDBOT.<init>(DISCORDBOT.java:37)
	at mod.minebot.proxy.ServerProxy.startBot(ServerProxy.java:34)
	at mod.minebot.MINEBOT.preInit(MINEBOT.java:75)
	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 net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637)
	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.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)
	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.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627)
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99)
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333)
	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections4.map.CaseInsensitiveMap
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:106)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 42 more


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

-- System Details --
Details:
	Minecraft Version: 1.12.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_211, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 863677704 bytes (823 MB) / 998768640 bytes (952 MB) up to 5712117760 bytes (5447 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.42 Powered by Forge 14.23.5.2838 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State | ID        | Version      | Source                                  | Signature                                |
	|:----- |:--------- |:------------ |:--------------------------------------- |:---------------------------------------- |
	| LCH   | minecraft | 1.12.2       | minecraft.jar                           | None                                     |
	| LCH   | mcp       | 9.42         | minecraft.jar                           | None                                     |
	| LCH   | FML       | 8.0.99.99    | forge-1.12.2-14.23.5.2838-universal.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
	| LCH   | forge     | 14.23.5.2838 | forge-1.12.2-14.23.5.2838-universal.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
	| LCE   | minebot   | 1.0          | minebot-1.0.jar                         | None                                     |

	Loaded coremods (and transformers): 
	Profiler Position: N/A (disabled)
	Is Modded: Definitely; Server brand changed to 'fml,forge'
	Type: Dedicated Server (map_server.txt)

but it did make a new folder called memory repo.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019

This is the structure of the mod folder:

image.thumb.png.6bb589c5b40f5680317c5515fffe8366.png

Is it supposed to be this way ?

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019

Ah two libraries don't have the right versions in their meta files. I'll fix that.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019

Still the same error.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted June 9, 2019

Classes in the org.apache.commons package cannot be loaded from the mods folder.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019
Just now, diesieben07 said:

Classes in the org.apache.commons package cannot be loaded from the mods folder.

How can I load it then ?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted June 9, 2019
Just now, GloriousAlpaca said:

How can I load it then ?

You have to change the package.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019

How should I do that ? I don't think I understand what you mean.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted June 9, 2019

This means FML will not attempt to load anything in the package org.apache.commons. from things in the mods folder. This is overzealous, as only org.apache.commons.lang3 and org.apache.commons.compress and some others should be excluded.

You can do the following very, very ugly hack (I do not recommend it):

public MINEBOT() throws NoSuchFieldException, IllegalAccessException {
	Field field = LaunchClassLoader.class.getDeclaredField("classLoaderExceptions");
	field.setAccessible(true);
	@SuppressWarnings("unchecked")
	Set<String> exclusions = (Set<String>) field.get(Launch.classLoader);
	exclusions.remove("org.apache.commons.");
	exclusions.add("org.apache.commons.lang3.");
	exclusions.add("org.apache.commons.compress.");
	exclusions.add("org.apache.commons.io.");
	exclusions.add("org.apache.commons.logging.");
	exclusions.add("org.apache.commons.codec.");
}

 

Alternatively you need to  change the package of the code.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019

Why exactly is it that ugly ?

What about shadowjar could I use that ?

And the alternative is that I rewrite the Library itself ?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted June 9, 2019
1 minute ago, GloriousAlpaca said:

Why exactly is it that ugly ?

  • Because it's a hacky mess of reflection.
  • Because it relies on a fixed set of libraries being included in Minecraft.
1 minute ago, GloriousAlpaca said:

What about shadowjar could I use that ?

You could, but it would require you to shadow in all of your dependencies and change all of their packages. It undermines all the benefits of the jar-in-jar system. Moreover shadowing has issues, because jars cannot always be merged seamlessly.

 

2 minutes ago, GloriousAlpaca said:

And the alternative is that I rewrite the Library itself ?

The alternative is that you change the package using some kind of transformation on the jars, similar how package changing would work with shadow.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019
4 minutes ago, diesieben07 said:

The alternative is that you change the package using some kind of transformation on the jars, similar how package changing would work with shadow.

Wouldn't that break the libraries that use it ?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted June 9, 2019
Just now, GloriousAlpaca said:

Wouldn't that break the libraries that use it ?

That's why I said you need a transformation process. Shadow also replaces all references to the package.

  • Quote

Share this post


Link to post
Share on other sites

GloriousAlpaca    2

GloriousAlpaca

GloriousAlpaca    2

  • Creeper Killer
  • GloriousAlpaca
  • Members
  • 2
  • 103 posts
Posted June 9, 2019
Just now, diesieben07 said:

That's why I said you need a transformation process. Shadow also replaces all references to the package.

Well, with the hacky mess the mod is working so thank you very much!
I'll still look into the transformation though.

Have a nice day!

  • Quote

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • Next
  • Page 2 of 2  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • JayNeedsHelp
      Logger not working

      By JayNeedsHelp · Posted 11 minutes ago

      So I'm currently creating a forge mod and I'm having an issue where the console stops logging after some errors. It seems to be connected to the access transformers that I'm using as before I added at's my console was working fine.   Here is my at file:  public-f net.minecraft.client.Minecraft session public net.minecraft.client.Minecraft timer public net.minecraft.client.gui.GuiScreen buttonList public net.minecraft.util.Timer tickLength public net.minecraft.network.play.client.CPacketPlayer onGround public net.minecraft.network.play.server.SPacketEntityVelocity motionX public net.minecraft.network.play.server.SPacketEntityVelocity motionY public net.minecraft.network.play.server.SPacketEntityVelocity motionZ public net.minecraft.network.play.server.SPacketExplosion motionX public net.minecraft.network.play.server.SPacketExplosion motionY public net.minecraft.network.play.server.SPacketExplosion motionZ public net.minecraft.client.renderer.entity.RenderManager renderPosX public net.minecraft.client.renderer.entity.RenderManager renderPosY public net.minecraft.client.renderer.entity.RenderManager renderPosZ   Any help is greatly appreciated thank you!
    • cadbane86140
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140 · Posted 1 hour ago

      Hello There! Today we are back on Hunger Games after a little break but we are finally back! In this episode we are on the good ol' map Survival Games 4 and it ACTUALLY went well for once. Also we have so many great battles on rooftops, small rooms and just out in the open! We also use shears to fight at one point and that was pretty crazy! There are so many hilarious moments in this episode that I know you guys are gonna love! I hope you all enjoy this video and if you did don't forget to like and sub for more Hunger Games in the future!  
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 1 hour ago

      latest.log
    • diesieben07
      Game crashes whenever I try to increase the RAM

      By diesieben07 · Posted 2 hours ago

      In the logs folder of your game directory.
    • Unusualty
      GUI'S and player editing

      By Unusualty · Posted 2 hours ago

      So I'm trying to make a mod that is inspired by Origin's because this mod isn't for forge I was wondering if anyone can help me do something like this where you get a GUI when you join the world where you can select a race that has abilities and down sides to them, I also want to have classes but first I want these race's done so if anyone can help this would be appreciated.
  • Topics

    • JayNeedsHelp
      0
      Logger not working

      By JayNeedsHelp
      Started 12 minutes ago

    • cadbane86140
      0
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140
      Started 1 hour ago

    • Sad Whale
      6
      Game crashes whenever I try to increase the RAM

      By Sad Whale
      Started 3 hours ago

    • Unusualty
      0
      GUI'S and player editing

      By Unusualty
      Started 2 hours ago

    • fluiX
      1
      server wont start

      By fluiX
      Started 3 hours ago

  • Who's Online (See full list)

    • _Traficantefav_
    • Lyon
    • JayNeedsHelp
    • PyRoTheLifeLess
    • Beethoven92
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] Library only working on runServer/runClient (java.lang.NoClassDefFoundError)
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community