CleanroomMC/MixinBooter

[Question] `LinkageError: loader constraint violation`

SettingDust opened this issue · 10 comments

Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "org/spongepowered/asm/launch/GlobalProperties$Keys"
	at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_372]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:757) ~[?:1.8.0_372]
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_372]
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) ~[?:1.8.0_372]
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[?:1.8.0_372]
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[?:1.8.0_372]
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_372]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_372]
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_372]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419) ~[?:1.8.0_372]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[?:1.8.0_372]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352) ~[?:1.8.0_372]
	at org.spongepowered.asm.launch.GlobalProperties.get(GlobalProperties.java:124) ~[mixinbooter-8.3.jar:?]
	at org.spongepowered.asm.launch.MixinBootstrap.isSubsystemRegistered(MixinBootstrap.java:206) ~[mixinbooter-8.3.jar:?]
	at org.spongepowered.asm.launch.MixinBootstrap.start(MixinBootstrap.java:139) ~[mixinbooter-8.3.jar:?]
	at org.spongepowered.asm.launch.MixinBootstrap.init(MixinBootstrap.java:128) ~[mixinbooter-8.3.jar:?]
	at zone.rong.mixinbooter.MixinBooterPlugin.<init>(MixinBooterPlugin.java:28) ~[mixinbooter-8.3.jar:?]

MixinBooter load the class twice. How can I avoiding that?

"main@1" prio=5 tid=0x1 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
	  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	  at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182)
	  at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	  - 锁定 <0x1c45> (net.minecraft.launchwrapper.LaunchClassLoader)
	  at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	  at org.spongepowered.asm.service.mojang.MixinServiceLaunchWrapper.<clinit>(MixinServiceLaunchWrapper.java:85)
	  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-1)
	  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	  at java.lang.Class.newInstance(Class.java:442)
	  at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
	  at java.util.ServiceLoader$LazyIterator.access$700(ServiceLoader.java:323)
	  at java.util.ServiceLoader$LazyIterator$2.run(ServiceLoader.java:407)
	  at java.security.AccessController.doPrivileged(AccessController.java:-1)
	  at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:409)
	  at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	  at org.spongepowered.asm.service.MixinService.initService(MixinService.java:238)
	  at org.spongepowered.asm.service.MixinService.getServiceInstance(MixinService.java:204)
	  - 锁定 <0x1c64> (org.spongepowered.asm.service.MixinService)
	  at org.spongepowered.asm.service.MixinService.getService(MixinService.java:198)
	  at org.spongepowered.asm.launch.MixinBootstrap.<clinit>(MixinBootstrap.java:88)
	  at zone.rong.mixinbooter.MixinBooterPlugin.<init>(MixinBooterPlugin.java:28)
	  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-1)
	  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	  at java.lang.Class.newInstance(Class.java:442)
	  at net.minecraftforge.fml.relauncher.CoreModManager.loadCoreMod(CoreModManager.java:593)
	  at net.minecraftforge.fml.relauncher.CoreModManager.handleLaunch(CoreModManager.java:262)
	  at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupHome(FMLLaunchHandler.java:107)
	  at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupClient(FMLLaunchHandler.java:81)
	  at net.minecraftforge.fml.relauncher.FMLLaunchHandler.configureForClientLaunch(FMLLaunchHandler.java:42)
	  at net.minecraftforge.fml.common.launcher.FMLTweaker.injectIntoClassLoader(FMLTweaker.java:139)
	  at net.minecraft.launchwrapper.Launch.launch(Launch.java:115)
	  at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	  at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
	  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	  at java.lang.reflect.Method.invoke(Method.java:498)
	  at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	  at GradleStart.main(GradleStart.java:25)
"main@1" prio=5 tid=0x1 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
	  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	  at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	  at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	  at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	  at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	  at java.security.AccessController.doPrivileged(AccessController.java:-1)
	  at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	  at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	  - 锁定 <0x1cfc> (java.lang.Object)
	  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	  at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	  at org.spongepowered.asm.launch.GlobalProperties.get(GlobalProperties.java:124)
	  at org.spongepowered.asm.launch.MixinBootstrap.isSubsystemRegistered(MixinBootstrap.java:206)
	  at org.spongepowered.asm.launch.MixinBootstrap.start(MixinBootstrap.java:139)
	  at org.spongepowered.asm.launch.MixinBootstrap.init(MixinBootstrap.java:128)
	  at zone.rong.mixinbooter.MixinBooterPlugin.<init>(MixinBooterPlugin.java:28)
	  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-1)
	  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	  at java.lang.Class.newInstance(Class.java:442)
	  at net.minecraftforge.fml.relauncher.CoreModManager.loadCoreMod(CoreModManager.java:593)
	  at net.minecraftforge.fml.relauncher.CoreModManager.handleLaunch(CoreModManager.java:262)
	  at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupHome(FMLLaunchHandler.java:107)
	  at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupClient(FMLLaunchHandler.java:81)
	  at net.minecraftforge.fml.relauncher.FMLLaunchHandler.configureForClientLaunch(FMLLaunchHandler.java:42)
	  at net.minecraftforge.fml.common.launcher.FMLTweaker.injectIntoClassLoader(FMLTweaker.java:139)
	  at net.minecraft.launchwrapper.Launch.launch(Launch.java:115)
	  at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	  at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
	  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	  at java.lang.reflect.Method.invoke(Method.java:498)
	  at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	  at GradleStart.main(GradleStart.java:25)

MixinBooter 7.1 works

Mod list?

In development env. No one with mixin besides mine. forge 2768
image

In development env. No one with mixin besides mine. forge 2768 image

Reproduce with only bloodmagic and guide api. Haven't tested without any mod

If you want to make mods that use Mixin, better use https://github.com/CleanroomMC/TemplateDevEnv

If you want to make mods that use Mixin, better use CleanroomMC/TemplateDevEnv

ForgeGradle 2.3 works with 2768 that isn't mdk3 XD. I've checked the template

We don't use ForgeGradle anymore

We don't use ForgeGradle anymore

Retro can't develop with 2768 sadly

Retro can't develop with 2768 sadly

erh... why would you need 2768?
Any specific reason?