HammerLib

HammerLib

37M Downloads

Failed to create mod instance. ModID: hammerlib, class org.zeith.hammerlib.HammerLib OR java.lang.NoClassDefFoundError: Could not initialize class org.zeith.hammerlib.HammerLib

Zeitheron opened this issue ยท 1 comments

commented

Why do I keep on getting this crash report?!

Forge loads mods in parallel, and whenever Java is requested to load a new class, a "Mixin" subsystem is initiated to compute injections and/or redirects, and other bytecode manipulations.

While it is useful for mod developers, a faulty mixin can cause the game to crash, and blame another mod.

HammerLib is loaded in the front of the mod list quite often and accesses a lot of classes when constructing, potentially hitting errored classes that have mixin conflicts.

So how do I track down the cause?!

Navigate to .minecraft/logs/latest.log, open that file with text editor. Look for the first hit of Failed to create mod instance. ModID: hammerlib, class org.zeith.hammerlib.HammerLib, and try and see for any errors ABOVE it.

They might look in a few common ways:

  • Mixin error:
    • [modloading-worker-0/WARN]: @Redirect conflict. Skipping globaldataandresourcepacks.mixins.json:PackConfigurationMixin->@Redirect::packConfiguration(Ljava/util/Set;Ljava/lang/Object;)Z with priority 1000, already redirected by create_new_age.mixins.json:MinecraftServerMixin->@Redirect::add(Ljava/util/Set;Ljava/lang/Object;)Z with priority 1000.
    • This is a common error. You can see the globaldataandresourcepacks.mixins.json and create_new_age.mixins.json in there. Those are the two mods conflicting with each other. Remove either to resolve the crash!
  • Stack trace error:
org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156) ~[modlauncher-10.0.8.jar:10.0.8+10.0.8+main.0ef7e830]
	at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.8.jar:?]
	at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.8.jar:?]
	at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.8.jar:?]
	at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.4.jar:?]
	at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?]
	at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.4.jar:?]
	at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?]
	at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.4.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
	at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:?]
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:3373) ~[?:?]
	at java.lang.Class.getConstructor0(Class.java:3578) ~[?:?]
	at java.lang.Class.getConstructor(Class.java:2271) ~[?:?]
	at net.minecraftforge.eventbus.api.EventListenerHelper.computeListenerList(EventListenerHelper.java:75) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.api.EventListenerHelper.lambda$getListenerListInternal$0(EventListenerHelper.java:56) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.LockHelper.computeIfAbsent(LockHelper.java:61) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.LockHelper.get(LockHelper.java:44) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.LockHelper.computeIfAbsent(LockHelper.java:39) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerListInternal(EventListenerHelper.java:56) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerList(EventListenerHelper.java:50) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.EventBus.addToListeners(EventBus.java:276) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:252) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:244) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:199) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:193) ~[eventbus-6.0.3.jar%2385!/:?]
	at net.minecraftforge.eventbus.EventBus.addListener(EventBus.java:187) ~[eventbus-6.0.3.jar%2385!/:?]
	at org.zeith.hammerlib.proxy.HLCommonProxy.<init>(HLCommonProxy.java:31) ~[HammerLib-1.19.2-19.3.76.jar%23436!/:19.3.76]
	at org.zeith.hammerlib.proxy.HLClientProxy.<init>(HLClientProxy.java:65) ~[HammerLib-1.19.2-19.3.76.jar%23436!/:19.3.76]
	at org.zeith.hammerlib.api.proxy.IProxy.create(IProxy.java:26) ~[HammerLib-1.19.2-19.3.76.jar%23436!/:19.3.76]
	at org.zeith.hammerlib.HammerLib.<clinit>(HammerLib.java:45) ~[HammerLib-1.19.2-19.3.76.jar%23436!/:19.3.76]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:68) ~[javafmllanguage-1.19.2-43.3.0.jar%23537!/:?]
	at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19.2-43.3.0.jar%23536!/:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?]
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) [?:?]
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Redirector packConfiguration(Ljava/util/Set;Ljava/lang/Object;)Z in globaldataandresourcepacks.mixins.json:PackConfigurationMixin failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap globaldataandresourcepacks.refmap.json
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:468) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1362) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1051) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:400) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4]
	... 48 more

This case is a bit trickier. You should be looking for lines from top-to-down, looking for things that are not Minecraft, (Neo)Forge nor Java.
In the example above, at org.zeith.hammerlib.proxy.HLCommonProxy.<init>(HLCommonProxy.java:31) is the first occurrence that matches our criteria.
Here HammerLib attempts to initialize its proxies and fails to do so, due to Mixins failing (first line is at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392) -- it threw an exception while applying mixins to a class), thus throwing the error upstream and causing a critical failure.

commented

TLDR; HammerLib is most likely NOT the cause of the startup crash of your modpack.