Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-14

forge install-plugin fails with ClassNotFoundException: org.apache.commons.cli.UnrecognizedOptionException

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0.0.Beta2
    • Fix Version/s: 1.0.0.Beta4
    • Component/s: UI - Shell
    • Labels:
      None
    • Environment:

      Description

      forge install-plugin fails. I could reproduce it with 1.0.0.Beta2 and 1.0.0-SNAPSHOT as well. I used zip distributions downloaded from jboss nexus.

      [forge-openshift-demo] forge-openshift-demo $ forge install-plugin openshift-express
      Connecting to remote repository https://raw.github.com/forge/plugin-repository/master/repository.yaml... connected!
      **INFO** Preparing to install plugin: openshift-express
      **INFO** Checking out plugin source files to [/tmp/forgetemp6992847724975759063/repo] via 'git'
      Receiving objects: 100% (169/169)
      Resolving deltas: 100% (66/66)
      **INFO** Invoking build with underlying build system.
      **ERROR** [forge install-plugin] org/apache/commons/cli/UnrecognizedOptionException
      org.jboss.forge.shell.exceptions.CommandExecutionException: org/apache/commons/cli/UnrecognizedOptionException
      at org.jboss.forge.shell.command.Execution.perform(Execution.java:151)
      at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)
      at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)
      at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:711)
      at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:495)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)
      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)
      at org.jboss.forge.shell.ShellImpl$Proxy$$$_WeldClientProxy.doShell(ShellImpl$Proxy$$$_WeldClientProxy.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
      at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
      at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
      at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
      at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
      at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
      at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
      at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
      at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
      at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
      at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)
      at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)
      at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)
      at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:87)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.forge.shell.command.Execution.perform(Execution.java:146)
      ... 30 more
      Caused by: java.lang.NoClassDefFoundError: org/apache/commons/cli/UnrecognizedOptionException
      at org.jboss.forge.maven.facets.MavenCoreFacetImpl.executeMavenEmbedded(MavenCoreFacetImpl.java:266)
      at org.jboss.forge.maven.facets.MavenCoreFacetImpl.executeMavenEmbedded(MavenCoreFacetImpl.java:256)
      at org.jboss.forge.maven.facets.MavenCoreFacetImpl.executeMaven(MavenCoreFacetImpl.java:287)
      at org.jboss.forge.maven.facets.MavenCoreFacetImpl.executeMaven(MavenCoreFacetImpl.java:275)
      at org.jboss.forge.maven.facets.MavenPackagingFacet.executeBuild(MavenPackagingFacet.java:155)
      at org.jboss.forge.shell.plugins.builtin.ForgePlugin.buildFromCurrentProject(ForgePlugin.java:471)
      at org.jboss.forge.shell.plugins.builtin.ForgePlugin.installFromGit(ForgePlugin.java:415)
      at org.jboss.forge.shell.plugins.builtin.ForgePlugin.installFromIndex(ForgePlugin.java:223)
      ... 35 more
      Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.UnrecognizedOptionException from [Module "org.jboss.forge.shell-api:main" from local module loader @5c1428ea (roots: /home/peter/Applications/forge-1.0.0-SNAPSHOT/modules,/home/peter/.forge/plugins)]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
      ... 43 more

      [forge-openshift-demo] forge-openshift-demo $ list-properties
      SHELL=org.jboss.forge.shell.ShellImpl@6838a3ca
      EXCEPTION_HANDLING=true
      VERBOSE=true
      IGNOREEOF=1
      DEFAULT_PLUGIN_REPO=https://raw.github.com/forge/plugin-repository/master/repository.yaml
      DEFFAULT_PLUGIN_REPO=https://raw.github.com/forge/plugin-repository/master/repository.yaml
      CWD=/home/peter/Projects/Sandbox/Forge/forge-openshift-demo
      OS_NAME=Linux
      PROMPT=[\c

      {green}$PROJECT_NAME\c] \c{blue}\W\c \c{green}

      \$\c
      PROMPT_NOPROJ=[\c

      {red}no project\c] \c{blue}\W\c \c{red}

      \$\c
      FORGE_CONFIG_DIR=/home/peter/.forge/
      OFFLINE=false
      NO_MOTD=false
      PROJECT_NAME=forge-openshift-demo

        Gliffy Diagrams

          Activity

          Hide
          lincolnthree Lincoln Baxter III added a comment -

          This probably would not work on Beta 2, but I am unable to reproduce the problem with the latest build from master. Can you try building Forge from source and see if you have the same problem? It seems like SNAPSHOTs are not being deployed to nexus because there is some issue going on there right now.

          Show
          lincolnthree Lincoln Baxter III added a comment - This probably would not work on Beta 2, but I am unable to reproduce the problem with the latest build from master. Can you try building Forge from source and see if you have the same problem? It seems like SNAPSHOTs are not being deployed to nexus because there is some issue going on there right now.
          Hide
          pmiklos Peter Miklos added a comment -

          I noticed that you just released Beta3. I quickly tried it, but I still experience with this exception. I can see that
          modules/org/jboss/forge/main/commons-cli.jar and modules/org/jboss/forge/shell-api/main/commons-cli.jar contain the UnrecognizedOptionException class. Is it possible to dump the classpath/modulepath somehow? That might help to further investigate it.

          Show
          pmiklos Peter Miklos added a comment - I noticed that you just released Beta3. I quickly tried it, but I still experience with this exception. I can see that modules/org/jboss/forge/main/commons-cli.jar and modules/org/jboss/forge/shell-api/main/commons-cli.jar contain the UnrecognizedOptionException class. Is it possible to dump the classpath/modulepath somehow? That might help to further investigate it.
          Hide
          pmiklos Peter Miklos added a comment -

          Well, I did not have maven on the PATH. After I installed maven 3.0.3 the error disappeared and forge successfully installed the plugin. I think the stack trace was a bit misleading. In fact, the documentation says "Consider installing Git and Maven 3.0+ (both optional)", but it seems they are not optional if you want to install a plugin.

          Show
          pmiklos Peter Miklos added a comment - Well, I did not have maven on the PATH. After I installed maven 3.0.3 the error disappeared and forge successfully installed the plugin. I think the stack trace was a bit misleading. In fact, the documentation says "Consider installing Git and Maven 3.0+ (both optional)", but it seems they are not optional if you want to install a plugin.
          Hide
          lincolnthree Lincoln Baxter III added a comment -

          Ah interesting. That could be why I was unable to reproduce it, since I do have maven installed. I'll probably need to change the module structure to fix this.

          Show
          lincolnthree Lincoln Baxter III added a comment - Ah interesting. That could be why I was unable to reproduce it, since I do have maven installed. I'll probably need to change the module structure to fix this.
          Hide
          lincolnthree Lincoln Baxter III added a comment -

          Reproduced the issue, working on fix.

          Show
          lincolnthree Lincoln Baxter III added a comment - Reproduced the issue, working on fix.
          Hide
          lincolnthree Lincoln Baxter III added a comment -

          All better! Try building from sources, or waiting for the next SNAPSHOT to deploy to nexus. Thanks for noticing this!

          Show
          lincolnthree Lincoln Baxter III added a comment - All better! Try building from sources, or waiting for the next SNAPSHOT to deploy to nexus. Thanks for noticing this!
          Hide
          pmiklos Peter Miklos added a comment -

          I just built it from source and I can confirm that it works now without having maven on the path.

          Show
          pmiklos Peter Miklos added a comment - I just built it from source and I can confirm that it works now without having maven on the path.

            People

            • Assignee:
              lincolnthree Lincoln Baxter III
              Reporter:
              pmiklos Peter Miklos
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development