java.lang.NullPointerException: null

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • ./nexus console after startup and logging stops. press Enter and then tab key then... {noformat} karaf@root()> *:exit *:help cl exit halt help la ld lde log:list ls man karaf@root()> la 2014-08-07 11:01:19,534-0300 ERROR [Karaf Console Local user karaf] org.apache.karaf.shell.util.ShellUtil - Exception caught while executing command java.lang.NullPointerException: null at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:61) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) [org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89) [org.apache.karaf.shell.console:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:521) [org.apache.karaf.shell.console:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:212) [org.apache.karaf.shell.console:3.0.1] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:126) [org.apache.karaf.shell.console:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:117) [org.apache.karaf.shell.console:3.0.1] at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_11] at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47) [org.apache.karaf.jaas.modules:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:115) [org.apache.karaf.shell.console:3.0.1] Error executing command: java.lang.NullPointerException {noformat}
    via by Peter Lynch,
  • Start fresh karaf 3 Karaf seems to come up fine but when you enter any command you get: 2012-06-14 14:15:33,306 | INFO | Thread-8 | Console | 39 - org.apache.karaf.shell.console - 3.0.0.SNAPSHOT | Exception caught while executing command java.lang.NullPointerException at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:61) at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:169) at java.lang.Thread.run(Thread.java:662)[:1.6.0_33] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:87)[39:org.apache.karaf.shell.console:3.0.0.SNAPSHOT] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:78) at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33] at javax.security.auth.Subject.doAs(Subject.java:337)[:1.6.0_33] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:76)[39:org.apache.karaf.shell.console:3.0.0.SNAPSHOT]
    via by Christian Schneider,
  • scr:list command is missing
    via GitHub by davsclaus
    ,
  • I have a shell command extending OsgiSupportCommand which always throws NullPointerException no matter what. {code} karaf@root> as:json Error executing command: java.lang.NullPointerException {code} trace: {code} 2012-10-19 21:10:43,862 | ERROR | l Console Thread | ServiceRecipe | lueprint.container.ServiceRecipe 294 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='shell-350'] java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926)[org.apache.felix.framework-4.0.3.jar:] at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:401)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.convertStringsToClasses(ServiceRecipe.java:416)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getClassesForProxying(ServiceRecipe.java:406)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:288)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:349)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:502)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.gogo.runtime.CommandProxy.getTarget(CommandProxy.java:50)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:72)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14:org.apache.karaf.shell.console:2.3.0] at java.lang.Thread.run(Thread.java:722)[:1.7.0_07] 2012-10-19 21:10:43,863 | ERROR | l Console Thread | ServiceRecipe | lueprint.container.ServiceRecipe 323 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='shell-350'] org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:295)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:349)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:502)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.gogo.runtime.CommandProxy.getTarget(CommandProxy.java:50)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:72)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14:org.apache.karaf.shell.console:2.3.0] at java.lang.Thread.run(Thread.java:722)[:1.7.0_07] Caused by: java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926)[org.apache.felix.framework-4.0.3.jar:] at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:401)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.convertStringsToClasses(ServiceRecipe.java:416)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getClassesForProxying(ServiceRecipe.java:406)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:288)[7:org.apache.aries.blueprint.core:1.0.1] ... 18 more 2012-10-19 21:10:43,865 | INFO | l Console Thread | Console | araf.shell.console.jline.Console 199 | 14 - org.apache.karaf.shell.console - 2.3.0 | Exception caught while executing command java.lang.NullPointerException at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:61)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14:org.apache.karaf.shell.console:2.3.0] at java.lang.Thread.run(Thread.java:722)[:1.7.0_07] {code} "help as:json" throws: {code} 2012-10-19 21:14:23,816 | ERROR | -[*:help, $args] | ServiceRecipe | lueprint.container.ServiceRecipe 294 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='shell-350'] java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926)[org.apache.felix.framework-4.0.3.jar:] at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:401)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.convertStringsToClasses(ServiceRecipe.java:416)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getClassesForProxying(ServiceRecipe.java:406)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:288)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:349)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:502)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.gogo.runtime.CommandProxy.getTarget(CommandProxy.java:50)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:72)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.SingleCommandHelpProvider.getHelp(SingleCommandHelpProvider.java:51)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem$1.getValue(HelpSystem.java:71)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.substVars(InterpolationHelper.java:174)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.performSubstitution(InterpolationHelper.java:84)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem.getHelp(HelpSystem.java:68)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpAction.doExecute(HelpAction.java:40)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] 2012-10-19 21:14:23,818 | ERROR | -[*:help, $args] | ServiceRecipe | lueprint.container.ServiceRecipe 323 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='shell-350'] org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:295)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:349)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:502)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.gogo.runtime.CommandProxy.getTarget(CommandProxy.java:50)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:72)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.SingleCommandHelpProvider.getHelp(SingleCommandHelpProvider.java:51)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem$1.getValue(HelpSystem.java:71)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.substVars(InterpolationHelper.java:174)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.performSubstitution(InterpolationHelper.java:84)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem.getHelp(HelpSystem.java:68)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpAction.doExecute(HelpAction.java:40)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] Caused by: java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926)[org.apache.felix.framework-4.0.3.jar:] at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:401)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.convertStringsToClasses(ServiceRecipe.java:416)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getClassesForProxying(ServiceRecipe.java:406)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:288)[7:org.apache.aries.blueprint.core:1.0.1] ... 28 more {code} "as:json --help" throws: {code} 2012-10-19 18:24:14,515 | ERROR | -[*:help, $args] | ServiceRecipe | lueprint.container.ServiceRecipe 294 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='shell-350'] java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926)[org.apache.felix.framework-4.0.3.jar:] at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:401)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.convertStringsToClasses(ServiceRecipe.java:416)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getClassesForProxying(ServiceRecipe.java:406)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:288)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:349)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:502)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.gogo.runtime.CommandProxy.getTarget(CommandProxy.java:50)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:72)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.SingleCommandHelpProvider.getHelp(SingleCommandHelpProvider.java:51)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem$1.getValue(HelpSystem.java:71)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.substVars(InterpolationHelper.java:174)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.performSubstitution(InterpolationHelper.java:84)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem.getHelp(HelpSystem.java:68)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpAction.doExecute(HelpAction.java:40)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] 2012-10-19 18:24:14,517 | ERROR | -[*:help, $args] | ServiceRecipe | lueprint.container.ServiceRecipe 323 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='shell-350'] org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:295)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:349)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:502)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.gogo.runtime.CommandProxy.getTarget(CommandProxy.java:50)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:72)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.SingleCommandHelpProvider.getHelp(SingleCommandHelpProvider.java:51)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem$1.getValue(HelpSystem.java:71)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.substVars(InterpolationHelper.java:174)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.util.InterpolationHelper.performSubstitution(InterpolationHelper.java:84)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpSystem.getHelp(HelpSystem.java:68)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.help.HelpAction.doExecute(HelpAction.java:40)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0] Caused by: java.lang.ClassNotFoundException: org.apache.felix.service.command.Function not found by soluvas-json [1774] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_07] at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723)[org.apache.felix.framework-4.0.3.jar:] at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926)[org.apache.felix.framework-4.0.3.jar:] at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:401)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.convertStringsToClasses(ServiceRecipe.java:416)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.getClassesForProxying(ServiceRecipe.java:406)[7:org.apache.aries.blueprint.core:1.0.1] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:288)[7:org.apache.aries.blueprint.core:1.0.1] ... 28 more {code} The actual code is not even executed yet. Command : {code} package org.soluvas.json; import org.apache.felix.gogo.commands.Argument; import org.apache.felix.gogo.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import com.fasterxml.jackson.databind.ObjectMapper; /** * Format any object as JSON. * @author ceefour */ @Command(scope="as", name="json", description="Format any object as JSON.") public class AsJsonCommand extends OsgiCommandSupport { // private transient Logger log = LoggerFactory.getLogger(AsJsonCommand.class); private ObjectMapper mapper; @Argument(name="object", required=true, description="Object to format as JSON, e.g. (process:find hello).") private Object input; public AsJsonCommand(ObjectMapper mapper) { super(); this.mapper = mapper; } /* (non-Javadoc) * @see org.apache.karaf.shell.console.AbstractAction#doExecute() */ @Override protected Object doExecute() throws Exception { return mapper.writeValueAsString(input); } } {code} Blueprint : {code} <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0 http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0"> <reference-list id="jacksonModuleSuppliers" interface="com.google.common.base.Supplier" filter="(className=com.fasterxml.jackson.databind.Module)" availability="optional"/> <bean id="jacksonMapperFactory" class="org.soluvas.json.JacksonMapperFactoryImpl" depends-on="jacksonModuleSuppliers"> <argument ref="jacksonModuleSuppliers"/> </bean> <service ref="jacksonMapperFactory" auto-export="interfaces"> <service-properties> <entry key="className" value="com.fasterxml.jackson.databind.ObjectMapper"/> </service-properties> </service> <bean id="jacksonMapper" factory-ref="jacksonMapperFactory" factory-method="get" scope="prototype"/> <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0"> <command name="as/json"> <action class="org.soluvas.json.AsJsonCommand"> <argument ref="jacksonMapper"/> </action> </command> </command-bundle> </blueprint> {code} Note: This is an open source project at: https://github.com/soluvas/soluvas-framework/tree/master/json
    via by Hendy Irawan,
    • java.lang.NullPointerException: null at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:61)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[org.apache.karaf.shell.console:3.0.1] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[org.apache.karaf.shell.console:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:521)[org.apache.karaf.shell.console:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:212)[org.apache.karaf.shell.console:3.0.1] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_11] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:126)[org.apache.karaf.shell.console:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:117)[org.apache.karaf.shell.console:3.0.1] at java.security.AccessController.doPrivileged(Native Method)[na:1.8.0_11] at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[org.apache.karaf.jaas.modules:3.0.1] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:115)[org.apache.karaf.shell.console:3.0.1]
    No Bugmate found.