[ https://issues.apache.org/jira/browse/JCLOUDS-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ignasi Barrera resolved JCLOUDS-1199. ------------------------------------- Resolution: Fixed Assignee: Ignasi Barrera Fix Version/s: 2.0.0 > jclouds-cli throws NPE in compute list commands > ----------------------------------------------- > > Key: JCLOUDS-1199 > URL: https://issues.apache.org/jira/browse/JCLOUDS-1199 > Project: jclouds > Issue Type: Bug > Components: jclouds-cli > Affects Versions: 2.0.0 > Reporter: Ignasi Barrera > Assignee: Ignasi Barrera > Fix For: 2.0.0 > > > In [this commit in > jclouds-karaf|https://github.com/jclouds/jclouds-karaf/commit/df7d4de364e7ccf4288c50ff44616e0cd691a4ae] > we changed the way in which the {{ScriptEngineManager}} was loaded. > Before that commit, the script engine manager was hardcoded to an instance > that did not work properly in OSGI environments, so we changed the way it was > initialised to let it be injected the right instance. > While this works well in Karaf, this breaks the jclouds-cli when not using > the interactive mode. When using the shell script, the CLI [directly creates > the Command > instances|https://github.com/jclouds/jclouds-cli/blob/master/runner/src/main/java/org/jclouds/cli/runner/Main.java#L347], > and those instances are now missing the {{ScriptEngineManager}} object, > resulting in the mentioned NPE. > My proposed fix would be to manually set the {{new ScriptEngineManager()}} in > the CLI, just after creating the command. This way the CLI keeps the legacy > behavior while we don't couple jclouds-karaf to a script engine that does not > work well in OSGi environments. -- This message was sent by Atlassian JIRA (v6.3.4#6332)