LXGaming / MixinBootstrap

MixinBootstrap is a temporary way of booting Mixin in a MinecraftForge production environment.
Apache License 2.0
54 stars 4 forks source link

Every time that i try to load any mixin on server prod environment with MixinBootstrap this happens #32

Closed augustresende closed 4 years ago

augustresende commented 4 years ago

Environment

Issue Description Every time that i try to load any mixin on server prod environment with MixinBootstrap this happens Not happens if forge dev server, not happens on forge dev client and not happens on forge prod client with mixinbootstrap


←[mException in thread "main" ←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:39)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.server.ServerMain.main(ServerMain.java:57)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]: Caused by: java.lang.reflect.InvocationTargetException
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at java.lang.reflect.Method.invoke(Unknown Source)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:-1]:         ... 7 more
←[m←[32m[15:02:17] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:-1]: Caused by: java.lang.IllegalAccessError: tried to access class com.google.common.collect.CollectPreconditions from class com.google.common.collect.Lists```

debug.log = https://pastebin.com/LQ22Tv55
LXGaming commented 4 years ago

Welcome to classloader hell.

Your IMixinConnector (MixinLoader) is loading the VexUtils class which is then loading net.minecraft.util.SharedConstants which then goes on to load a bunch of other classes.

Avoid loading Minecraft classes from your IMixinConnector and from any classes your IMixinConnector calls otherwise you will end up with these really weird and random issues.

Also I see your refmap is named mixin.refmap.json I highly recommend you rename this to be unique such as mixins.vanillaexperience.refmap.json as the files can be overwritten by other mods who also use the same refmap name.

augustresende commented 4 years ago

@LXGaming thanks, how can i change the refmap name? Is build.gradle thing? please help me.

LXGaming commented 4 years ago

You can find an example here: https://github.com/qouteall/ForgeWithMixinExample

You can rename the refmap by adding the following to your forge build.gradle:

mixin {
    add sourceSets.main, "you_should_rename_this.refmap.json"
}

Then in your forge mixin configs change the refmap entry.

augustresende commented 4 years ago

Thanks very much.