You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by asookazian2 <as...@gmail.com> on 2016/04/25 18:23:52 UTC

NPE when using bundle:id

karaf> system:version 
3.0.3

karaf> bundle:id "foo"
Error executing command: java.lang.NullPointerException

2016-04-25 09:20:51,190 | ERROR | l for user karaf | ShellUtil                       
| 27 - org.apache.karaf.shell.console - 3.0.3 | Exception caught while
executing command
java.lang.NullPointerException
	at
org.apache.karaf.bundle.command.Id.doExecute(Id.java:48)[31:org.apache.karaf.bundle.command:3.0.3]
	at
org.apache.karaf.bundle.command.Id.doExecute(Id.java:40)[31:org.apache.karaf.bundle.command:3.0.3]
	at
org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.3]
	at Proxy65aa54bc_9353_425d_8c20_861c5754e083.execute(Unknown Source)[:]
	at Proxy65aa54bc_9353_425d_8c20_861c5754e083.execute(Unknown Source)[:]
	at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[27:org.apache.karaf.shell.console:3.0.3]
	at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
	at
org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208)
	at
org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109)
	at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_45]
	at
org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.3]
	at
org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.3]



--
View this message in context: http://karaf.922171.n3.nabble.com/NPE-when-using-bundle-id-tp4046355.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: NPE when using bundle:id

Posted by Morgan Hautman <mo...@gmail.com>.
Hi,

On a Fresh 3.0.3 install:

karaf@root()> bundle:id "System Bundle"
0
karaf@root()> bundle:id "OPS4J Pax Url - aether:"
1

But indeed when there is a bundle that is not known it should not give a 
NPE back.

I think you are free to log a ticket, I will submit a PR if you don't do 
it. :)

Regards,
Morgan

On 2016-04-25 18:23, asookazian2 wrote:
> karaf> system:version
> 3.0.3
>
> karaf> bundle:id "foo"
> Error executing command: java.lang.NullPointerException
>
> 2016-04-25 09:20:51,190 | ERROR | l for user karaf | ShellUtil
> | 27 - org.apache.karaf.shell.console - 3.0.3 | Exception caught while
> executing command
> java.lang.NullPointerException
> 	at
> org.apache.karaf.bundle.command.Id.doExecute(Id.java:48)[31:org.apache.karaf.bundle.command:3.0.3]
> 	at
> org.apache.karaf.bundle.command.Id.doExecute(Id.java:40)[31:org.apache.karaf.bundle.command:3.0.3]
> 	at
> org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.3]
> 	at Proxy65aa54bc_9353_425d_8c20_861c5754e083.execute(Unknown Source)[:]
> 	at Proxy65aa54bc_9353_425d_8c20_861c5754e083.execute(Unknown Source)[:]
> 	at
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
> 	at
> org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208)
> 	at
> org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109)
> 	at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_45]
> 	at
> org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.3]
> 	at
> org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.3]
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/NPE-when-using-bundle-id-tp4046355.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: NPE when using bundle:id

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

it sounds like a bug when the regex is not matched.

Please, create a Jira (or I can do it for you), and I will fix that.

Thanks,
Regards
JB

On 04/25/2016 06:23 PM, asookazian2 wrote:
> karaf> system:version
> 3.0.3
>
> karaf> bundle:id "foo"
> Error executing command: java.lang.NullPointerException
>
> 2016-04-25 09:20:51,190 | ERROR | l for user karaf | ShellUtil
> | 27 - org.apache.karaf.shell.console - 3.0.3 | Exception caught while
> executing command
> java.lang.NullPointerException
> 	at
> org.apache.karaf.bundle.command.Id.doExecute(Id.java:48)[31:org.apache.karaf.bundle.command:3.0.3]
> 	at
> org.apache.karaf.bundle.command.Id.doExecute(Id.java:40)[31:org.apache.karaf.bundle.command:3.0.3]
> 	at
> org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.3]
> 	at Proxy65aa54bc_9353_425d_8c20_861c5754e083.execute(Unknown Source)[:]
> 	at Proxy65aa54bc_9353_425d_8c20_861c5754e083.execute(Unknown Source)[:]
> 	at
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[27:org.apache.karaf.shell.console:3.0.3]
> 	at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
> 	at
> org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208)
> 	at
> org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109)
> 	at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_45]
> 	at
> org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.3]
> 	at
> org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.3]
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/NPE-when-using-bundle-id-tp4046355.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com