Uploaded image for project: 'WildFly Maven Plugin'
  1. WildFly Maven Plugin
  2. WFMP-111

Using the execute-commands goal results in Maven hanging due to a CLI shutdown hook

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 2.0.0.Final
    • None
    • Maven Plugin
    • None

      There's an issue with Maven and the the CLI shutdown hook which causes the maven process to not exit with a new version of Xnio.

      jperkins@localhost ~/projects/jboss/examples/javaee/simple-servlet (master *+) $ mvn wildfly:execute-commands
      [INFO] Scanning for projects...
      [INFO] 
      [INFO] --------------< org.jboss.examples.javaee:simple-servlet >--------------
      [INFO] Building simple-servlet 1.0.0-SNAPSHOT
      [INFO] --------------------------------[ war ]---------------------------------
      [INFO] 
      [INFO] --- wildfly-maven-plugin:1.3.0.Alpha1-SNAPSHOT:execute-commands (default-cli) @ simple-servlet ---
      [INFO] JBoss Threads version 2.3.2.Final
      WARN: can't find jboss-cli.xml. Using default configuration values.
      [INFO] XNIO version 3.6.5.Final
      [INFO] XNIO NIO Implementation Version 3.6.5.Final
      [INFO] JBoss Remoting version 5.0.8.Final
      [INFO] ELY00001: WildFly Elytron version 1.6.0.Final
      [INFO] Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
      Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.
      [INFO] {
          "outcome" => "success",
          "result" => "STANDALONE"
      }
      {
          "outcome" => "success",
          "result" => "STANDALONE"
      }
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1.696 s
      [INFO] Finished at: 2018-10-11T16:22:15-07:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Close handler threw an exception
      java.lang.NoClassDefFoundError: org/xnio/XnioWorker$ExternalTaskPool
          at org.xnio.XnioWorker.isTaskPoolExternal (XnioWorker.java:824)
          at org.xnio.XnioWorker.shutDownTaskPool (XnioWorker.java:791)
          at org.xnio.nio.NioXnioWorker.shutdown (NioXnioWorker.java:284)
          at org.jboss.remoting3.EndpointImpl.finishPhase1 (EndpointImpl.java:348)
          at org.jboss.remoting3.EndpointImpl.closeTick1 (EndpointImpl.java:331)
          at org.jboss.remoting3.EndpointImpl.lambda$addConnectionProvider$8 (EndpointImpl.java:688)
          at org.jboss.remoting3.spi.SpiUtils.safeHandleClose (SpiUtils.java:50)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable$CloseHandlerTask.run (AbstractHandleableCloseable.java:520)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.runCloseTask (AbstractHandleableCloseable.java:425)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeComplete (AbstractHandleableCloseable.java:286)
          at org.jboss.remoting3.remote.RemoteConnectionProvider.closeAction (RemoteConnectionProvider.java:303)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync (AbstractHandleableCloseable.java:368)
          at org.jboss.remoting3.EndpointImpl.closeAction (EndpointImpl.java:400)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.close (AbstractHandleableCloseable.java:150)
          at org.jboss.as.cli.impl.CLIModelControllerClient$1.shutdown (CLIModelControllerClient.java:92)
          at org.jboss.as.cli.impl.CliShutdownHook$1.run (CliShutdownHook.java:50)
          at java.lang.Thread.run (Thread.java:748)
      Caused by: java.lang.ClassNotFoundException: org.xnio.XnioWorker$ExternalTaskPool
          at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
          at org.xnio.XnioWorker.isTaskPoolExternal (XnioWorker.java:824)
          at org.xnio.XnioWorker.shutDownTaskPool (XnioWorker.java:791)
          at org.xnio.nio.NioXnioWorker.shutdown (NioXnioWorker.java:284)
          at org.jboss.remoting3.EndpointImpl.finishPhase1 (EndpointImpl.java:348)
          at org.jboss.remoting3.EndpointImpl.closeTick1 (EndpointImpl.java:331)
          at org.jboss.remoting3.EndpointImpl.lambda$addConnectionProvider$8 (EndpointImpl.java:688)
          at org.jboss.remoting3.spi.SpiUtils.safeHandleClose (SpiUtils.java:50)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable$CloseHandlerTask.run (AbstractHandleableCloseable.java:520)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.runCloseTask (AbstractHandleableCloseable.java:425)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeComplete (AbstractHandleableCloseable.java:286)
          at org.jboss.remoting3.remote.RemoteConnectionProvider.closeAction (RemoteConnectionProvider.java:303)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync (AbstractHandleableCloseable.java:368)
          at org.jboss.remoting3.EndpointImpl.closeAction (EndpointImpl.java:400)
          at org.jboss.remoting3.spi.AbstractHandleableCloseable.close (AbstractHandleableCloseable.java:150)
          at org.jboss.as.cli.impl.CLIModelControllerClient$1.shutdown (CLIModelControllerClient.java:92)
          at org.jboss.as.cli.impl.CliShutdownHook$1.run (CliShutdownHook.java:50)
          at java.lang.Thread.run (Thread.java:748)
      

      A workaround would be to avoid using the CommandContext.connectController() which seems to register the shutdown hook. The other option is to launch CLI in a new process, however there is a performance penalty with that which seems fairly expensive. About an extra second per run.

              jperkins-rhn James Perkins
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: