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 when using extension #18

Open
marquiswang opened this issue Jun 17, 2024 · 0 comments
Open

ClassCastException when using extension #18

marquiswang opened this issue Jun 17, 2024 · 0 comments

Comments

@marquiswang
Copy link

I have concurrent-build-logger installed in my .mvn/extensions.xml

% cat .mvn/extensions.xml
<extensions>
	<extension>
		<groupId>io.takari.maven</groupId>
		<artifactId>concurrent-build-logger</artifactId>
		<version>0.2.1</version>
	</extension>
</extensions>

but when I run it I get:

% mvn clean install -T1C -Dmaven.logging=
[ERROR] Internal error: java.lang.ClassCastException: class org.slf4j.impl.MavenSimpleLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext (org.slf4j.impl.MavenSimpleLoggerFactory is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @78308db1; ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @392a04e7) -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.ClassCastException: class org.slf4j.impl.MavenSimpleLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext (org.slf4j.impl.MavenSimpleLoggerFactory is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @78308db1; ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @392a04e7)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:109)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.lang.ClassCastException: class org.slf4j.impl.MavenSimpleLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext (org.slf4j.impl.MavenSimpleLoggerFactory is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @78308db1; ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @392a04e7)
    at io.takari.maven.logback.internal.LogbackConfiguration.afterSessionStart (LogbackConfiguration.java:45)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:188)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)

These are the relevant versions that I'm using:

% mvn -v
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /home/.sdkman/candidates/maven/current
Java version: 17.0.7, vendor: Azul Systems, Inc., runtime: /home/.sdkman/candidates/java/17.0.7.fx-zulu
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.14.0-284.11.1.el9_2.x86_64", arch: "amd64", family: "unix"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant