-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.0.0.Final, 4.2.2.Final
-
None
I'm running into an error when adding a new module through a cli script, when it gets run by the wildfly maven plugin.
I've made a minimal project to reproduce the error: https://github.com/rbbl-dev/wildfly-maven-plugin-issue-example
Running the same cli script manually works just fine.
The templated version will end up in target/classes/011-add-configuration-module.cli
any other cli scripts i've ran also worked fine but i excluded them to keep the example minimal.
Error:
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:4.2.2.Final:execute-commands (configure-wildfly) on project wildfly-maven-plugin-issue-example: null: MojoExecutionException: InvocationTargetException: java.util.concurrent.ExecutionException: java.lang.IllegalAccessError: failed to access class org.jboss.staxmapper.FormattingXMLStreamWriter from class org.jboss.as.cli.handlers.module.ASModuleHandler (org.jboss.staxmapper.FormattingXMLStreamWriter is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @221ca495; org.jboss.as.cli.handlers.module.ASModuleHandler is in unnamed module of loader java.net.URLClassLoader @7c682e26) -> [Help 1]
you only need to run "mvn install" in my sample project to reproduce.
The master branch contains the current version (4.2.2.Final) of the plugin.
The first-broken-version branch contains version 3.0.0.Final where the error first occurs.
The last-working-version branch contains version 2.1.0.Final which is the last version where it works as expected.
in case it matters: i've tested this on a 20.04 ubuntu install with both java 11 and java 17
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:4.2.2.Final:execute-commands (configure-wildfly) on project wildfly-maven-plugin-issue-example: null: MojoExecutionException: InvocationTargetException: java.util.concurrent.ExecutionException: java.lang.IllegalAccessError: failed to access class org.jboss.staxmapper.FormattingXMLStreamWriter from class org.jboss.as.cli.handlers.module.ASModuleHandler (org.jboss.staxmapper.FormattingXMLStreamWriter is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @60d40ff4; org.jboss.as.cli.handlers.module.ASModuleHandler is in unnamed module of loader java.net.URLClassLoader @3b2db389) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:4.2.2.Final:execute-commands (configure-wildfly) on project wildfly-maven-plugin-issue-example: null at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) 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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) 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: org.apache.maven.plugin.MojoExecutionException at org.wildfly.plugin.cli.CommandExecutor.execute (CommandExecutor.java:76) at org.wildfly.plugin.cli.ExecuteCommandsMojo.execute (ExecuteCommandsMojo.java:262) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) 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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) 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.reflect.InvocationTargetException at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:118) at java.lang.reflect.Method.invoke (Method.java:580) at org.wildfly.plugin.cli.CLIWrapper.handle (CLIWrapper.java:74) at org.wildfly.plugin.cli.LocalCLIExecutor.handle (LocalCLIExecutor.java:113) at org.wildfly.plugin.cli.LocalCLIExecutor.executeCommands (LocalCLIExecutor.java:105) at org.wildfly.plugin.cli.CommandExecutor.executeInProcess (CommandExecutor.java:147) at org.wildfly.plugin.cli.CommandExecutor.execute (CommandExecutor.java:74) at org.wildfly.plugin.cli.ExecuteCommandsMojo.execute (ExecuteCommandsMojo.java:262) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) 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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) 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: org.jboss.as.cli.CommandLineException: java.util.concurrent.ExecutionException: java.lang.IllegalAccessError: failed to access class org.jboss.staxmapper.FormattingXMLStreamWriter from class org.jboss.as.cli.handlers.module.ASModuleHandler (org.jboss.staxmapper.FormattingXMLStreamWriter is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @60d40ff4; org.jboss.as.cli.handlers.module.ASModuleHandler is in unnamed module of loader java.net.URLClassLoader @3b2db389) at org.jboss.as.cli.impl.CommandContextImpl.execute (CommandContextImpl.java:944) at org.jboss.as.cli.impl.CommandContextImpl.handleLegacyCommand (CommandContextImpl.java:1945) at org.jboss.as.cli.impl.CommandContextImpl.handle (CommandContextImpl.java:881) at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) at org.wildfly.plugin.cli.CLIWrapper.handle (CLIWrapper.java:74) at org.wildfly.plugin.cli.LocalCLIExecutor.handle (LocalCLIExecutor.java:113) at org.wildfly.plugin.cli.LocalCLIExecutor.executeCommands (LocalCLIExecutor.java:105) at org.wildfly.plugin.cli.CommandExecutor.executeInProcess (CommandExecutor.java:147) at org.wildfly.plugin.cli.CommandExecutor.execute (CommandExecutor.java:74) at org.wildfly.plugin.cli.ExecuteCommandsMojo.execute (ExecuteCommandsMojo.java:262) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) 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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) 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.util.concurrent.ExecutionException: java.lang.IllegalAccessError: failed to access class org.jboss.staxmapper.FormattingXMLStreamWriter from class org.jboss.as.cli.handlers.module.ASModuleHandler (org.jboss.staxmapper.FormattingXMLStreamWriter is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @60d40ff4; org.jboss.as.cli.handlers.module.ASModuleHandler is in unnamed module of loader java.net.URLClassLoader @3b2db389) at java.util.concurrent.FutureTask.report (FutureTask.java:122) at java.util.concurrent.FutureTask.get (FutureTask.java:191) at org.jboss.as.cli.impl.CommandExecutor.execute (CommandExecutor.java:732) at org.jboss.as.cli.impl.CommandExecutor.execute (CommandExecutor.java:713) at org.jboss.as.cli.impl.CommandContextImpl.lambda$handleLegacyCommand$4 (CommandContextImpl.java:1946) at org.jboss.as.cli.impl.CommandContextImpl.execute (CommandContextImpl.java:931) at org.jboss.as.cli.impl.CommandContextImpl.handleLegacyCommand (CommandContextImpl.java:1945) at org.jboss.as.cli.impl.CommandContextImpl.handle (CommandContextImpl.java:881) at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) at org.wildfly.plugin.cli.CLIWrapper.handle (CLIWrapper.java:74) at org.wildfly.plugin.cli.LocalCLIExecutor.handle (LocalCLIExecutor.java:113) at org.wildfly.plugin.cli.LocalCLIExecutor.executeCommands (LocalCLIExecutor.java:105) at org.wildfly.plugin.cli.CommandExecutor.executeInProcess (CommandExecutor.java:147) at org.wildfly.plugin.cli.CommandExecutor.execute (CommandExecutor.java:74) at org.wildfly.plugin.cli.ExecuteCommandsMojo.execute (ExecuteCommandsMojo.java:262) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) 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.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103) at java.lang.reflect.Method.invoke (Method.java:580) 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.IllegalAccessError: failed to access class org.jboss.staxmapper.FormattingXMLStreamWriter from class org.jboss.as.cli.handlers.module.ASModuleHandler (org.jboss.staxmapper.FormattingXMLStreamWriter is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @60d40ff4; org.jboss.as.cli.handlers.module.ASModuleHandler is in unnamed module of loader java.net.URLClassLoader @3b2db389) at org.jboss.as.cli.handlers.module.ASModuleHandler.create (ASModuleHandler.java:583) at org.jboss.as.cli.handlers.module.ASModuleHandler.addModule (ASModuleHandler.java:493) at org.jboss.as.cli.handlers.module.ASModuleHandler.doHandle (ASModuleHandler.java:346) at org.jboss.as.cli.handlers.CommandHandlerWithHelp.handle (CommandHandlerWithHelp.java:89) at org.jboss.as.cli.impl.CommandExecutor$2.lambda$build$0 (CommandExecutor.java:704) at org.jboss.as.cli.impl.CommandExecutor.lambda$execute$0 (CommandExecutor.java:727) at java.util.concurrent.FutureTask.run (FutureTask.java:317) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1144) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:642) at java.lang.Thread.run (Thread.java:1583)