Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException #238

Closed
Cubxity opened this issue Mar 12, 2018 · 19 comments
Closed

ClassCastException #238

Cubxity opened this issue Mar 12, 2018 · 19 comments

Comments

@Cubxity
Copy link

Cubxity commented Mar 12, 2018

Stacktrace:

SEVERE: Unable to launch
java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLogger cannot be cast to org.apache.logging.log4j.core.Logger
	at org.spongepowered.asm.mixin.MixinEnvironment$MixinLogger.<init>(MixinEnvironment.java:679)
	at org.spongepowered.asm.mixin.MixinEnvironment.init(MixinEnvironment.java:1235)
	at org.spongepowered.asm.launch.MixinBootstrap.start(MixinBootstrap.java:157)
	at org.spongepowered.asm.launch.MixinBootstrap.init(MixinBootstrap.java:122)
	at cc.hyperium.launch.HyperiumTweaker.injectIntoClassLoader(HyperiumTweaker.kt:224)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:111)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:27)```
Does anyone know what is the problem?
@mikroskeem
Copy link

What Mixin library version?

@Cubxity
Copy link
Author

Cubxity commented Mar 12, 2018

0.6.4 SNAPSHOT

compile('org.spongepowered:mixin:0.6.4-SNAPSHOT') {
        exclude module: 'launchwrapper'
        exclude module: 'guava'
        exclude module: 'gson'
        exclude module: 'commons-io'
        }```

@mikroskeem
Copy link

org.apache.logging.log4j.core.Logger log = (org.apache.logging.log4j.core.Logger)LogManager.getLogger("FML"); is (possible) culprit.

@Cubxity
Copy link
Author

Cubxity commented Mar 12, 2018

Wdym?

@Cubxity
Copy link
Author

Cubxity commented Mar 12, 2018

  • I am not using Forge

@mikroskeem
Copy link

You don't need to use Forge for that. MixinLogger class expects Log4j2 LogManager#getLogger to return org.apache.logging.log4j.core.Logger implementation, but that's not in the case.

So any idea how SimpleLogger gets used instead?

@Cubxity
Copy link
Author

Cubxity commented Mar 12, 2018

I have no idea, the source code is at https://github.com/HyperiumClient/Hyperium you can take a look

@mikroskeem
Copy link

Looks like log4j-core is not available for some reason. I suggest Hyperium developers to find workaround for that. Furthermore Mixin could implement instanceof check to not catch fire like this on startup :P

@Cubxity
Copy link
Author

Cubxity commented Mar 12, 2018

When I run the client from Workspace it worked fine, but not when I run from the launcher

@Cubxity
Copy link
Author

Cubxity commented Mar 15, 2018

Anyone?

@Mumfrey
Copy link
Member

Mumfrey commented Mar 16, 2018

Sorry I'm away at the moment until early next week. I'll take a look into it when I get back, I suspect there's a simple fix for it but that code was added as part of the initphase scaffolding so I can't remember who wrote it or why it would use a concrete class rather than an interface.

@Cubxity
Copy link
Author

Cubxity commented Mar 24, 2018

SEVERE: Unable to launch
java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLogger cannot be cast to org.apache.logging.log4j.core.Logger
	at org.spongepowered.asm.mixin.MixinEnvironment.gotoPhase(MixinEnvironment.java:1431)
	at org.spongepowered.asm.mixin.EnvironmentStateTweaker.getLaunchArguments(EnvironmentStateTweaker.java:58)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:122)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

Still does not work, please reopen

@Cubxity
Copy link
Author

Cubxity commented Mar 24, 2018

@Mumfrey

@Mumfrey Mumfrey reopened this Mar 26, 2018
@Cubxity
Copy link
Author

Cubxity commented Mar 26, 2018

@Mumfrey so I need to use version 0.7.7 right?

@Mumfrey
Copy link
Member

Mumfrey commented Mar 26, 2018

Yes. In general you should always be using the latest version because Mixin guarantees backward compatibility so your mixins will not break with newer versions, however you benefit from improvements in the core and in compatibility and stability improvements.

@Mumfrey
Copy link
Member

Mumfrey commented Mar 26, 2018

See also this PSA about the use of minVersion.

@Cubxity
Copy link
Author

Cubxity commented Mar 26, 2018

is the maven repo updated?

@Cubxity
Copy link
Author

Cubxity commented Mar 26, 2018

also do you have discord so I can contact you easier?

@Mumfrey
Copy link
Member

Mumfrey commented Mar 26, 2018

is the maven repo updated?

Yes.

also do you have discord so I can contact you easier?

No I can't stand discord, you can contact me on IRC in #spongedev on esper if necessary. If my nick name has uppercase M then I'm online, lowercase m is my bouncer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants