You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by to...@quarendon.net on 2017/06/13 13:51:18 UTC

Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Start up Karaf with the "bin/karaf.bat" shell script.

At the console type
help bundle:info
You get:
gogo: NullPointerException: "in" is null!

If I run this from the official 4.1.1 install, it looks like this is trying to "more" the help contents or something. I get a colon, and if you press q it goes back to the prompt. You get no help output though. If I do the same on 4.0.6, I get paginated help out, so something has changed there.

Run this from a "custom assembly" consisting of the "standard" feature, and I get:


2017-06-13T14:33:11,173 | ERROR | Karaf local console user karaf | ShellUtil                        | 55 - org.apache.karaf.shell.core - 4.1.1 | Exception caught while executing command
java.lang.NumberFormatException: For input string: "43B"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
	at java.lang.Integer.parseInt(Integer.java:580) [?:?]
	at java.lang.Integer.<init>(Integer.java:867) [?:?]
	at org.fusesource.jansi.AnsiOutputStream.write(AnsiOutputStream.java:122) [86:org.fusesource.jansi:1.14.0]
	at java.io.FilterOutputStream.write(FilterOutputStream.java:125) [?:?]
	at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:458) [?:?]
	at org.apache.felix.gogo.runtime.Pipe$MultiChannel.write(Pipe.java:644) [55:org.apache.karaf.shell.core:4.1.1]
	at java.nio.channels.Channels.writeFullyImpl(Channels.java:78) [?:?]
	at java.nio.channels.Channels.writeFully(Channels.java:101) [?:?]
	at java.nio.channels.Channels.access$000(Channels.java:61) [?:?]
	at java.nio.channels.Channels$1.write(Channels.java:174) [?:?]
	at java.io.PrintStream.write(PrintStream.java:480) [?:?]
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) [?:?]
	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291) [?:?]
	at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104) [?:?]
	at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185) [?:?]
	at java.io.PrintStream.write(PrintStream.java:527) [?:?]
	at java.io.PrintStream.print(PrintStream.java:669) [?:?]
	at java.io.PrintStream.println(PrintStream.java:806) [?:?]
	at org.apache.felix.gogo.jline.Posix._main(Posix.java:128) [55:org.apache.karaf.shell.core:4.1.1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
	at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:136) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.karaf.shell.impl.console.SessionFactoryImpl$ShellCommand.lambda$wrap$0(SessionFactoryImpl.java:195) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.karaf.shell.impl.console.SessionFactoryImpl$ShellCommand$$Lambda$37/1313854807.execute(Unknown Source) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.karaf.shell.impl.console.SessionFactoryImpl$ShellCommand.execute(SessionFactoryImpl.java:241) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:560) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:486) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:375) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [55:org.apache.karaf.shell.core:4.1.1]
	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [55:org.apache.karaf.shell.core:4.1.1]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:745) [?:?]
2017-06-13T14:33:11,177 | ERROR | Karaf local console user karaf | ShellUtil                        | 55 - org.apache.karaf.shell.core - 4.1.1 | Exception caught while executing command
java.lang.NumberFormatException: For input string: "43BF"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
	at java.lang.Integer.parseInt(Integer.java:580) [?:?]
	at java.lang.Integer.<init>(Integer.java:867) [?:?]
	at org.fusesource.jansi.AnsiOutputStream.write(AnsiOutputStream.java:122) [86:org.fusesource.jansi:1.14.0]
	at java.io.FilterOutputStream.write(FilterOutputStream.java:125) [?:?]
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) [?:?]
	at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282) [?:?]
	at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125) [?:?]
	at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135) [?:?]
	at java.io.OutputStreamWriter.write(OutputStreamWriter.java:220) [?:?]
	at java.io.PrintWriter.write(PrintWriter.java:456) [?:?]
	at java.io.PrintWriter.write(PrintWriter.java:473) [?:?]
	at org.jline.utils.Display.rawPrint(Display.java:490) [87:org.jline:3.2.0]
	at org.jline.utils.Display.update(Display.java:253) [87:org.jline:3.2.0]
	at org.jline.reader.impl.LineReaderImpl.redisplay(LineReaderImpl.java:3361) [87:org.jline:3.2.0]
	at org.jline.reader.impl.LineReaderImpl.cleanup(LineReaderImpl.java:2195) [87:org.jline:3.2.0]
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:567) [87:org.jline:3.2.0]
	at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:339) [55:org.apache.karaf.shell.core:4.1.1]
	at java.lang.Thread.run(Thread.java:745) [?:?]

followed (eventually) by program termination.

I'm running on Windows if it makes a difference.
I try the same with 4.0.6 and in both cases I get paginated help output. 
A difference is that it doesn't attempt to highlight the commands as you type them, which on Windows renders them unreadable anyway, since the console is black. Is this related to that?

Is this a known problem with 4.1?

Thanks.

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Posted by to...@quarendon.net.
> On 13 June 2017 at 16:50 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> 
> Yeah, you have to add the snapshot repository in your pom.xml:
OK, yes, that's better.
Thanks.


Now all I need to do is work out why I can't apparently satisfy 
   (&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"
despite Karaf including SCR. 

Hmm. Karaf seems to have SCR 2.0.10. I don't know why I need <2, it's just what bndtools builds in as a requirement. Ah, confusion between API version and software version. 
from Karaf console, bundle:headers on felix.scr:
   osgi.extender;uses:=org.osgi.service.component;osgi.extender=osgi.component;version:Version=1.3
which is presumably what the requirement is referencing, so that ought to be satisfied.

So no idea why that requirement can't be satisfied.
Anyway, that's for tomorrow.

Thanks.

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yeah, you have to add the snapshot repository in your pom.xml:

     <repositories>
         <!-- Apache snapshots -->
         <repository>
             <id>apache-snapshots</id>
             <name>Apache Snapshots Repository</name>
             <url>http://repository.apache.org/content/groups/snapshots-group</url>
             <releases>
                 <enabled>false</enabled>
             </releases>
             <snapshots>
                 <enabled>true</enabled>
             </snapshots>
         </repository>
    </repositories>

Regards
JB

On 06/13/2017 05:49 PM, tom@quarendon.net wrote:
> 
>> On 13 June 2017 at 15:50 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>>
>> Do you have a chance to test with 4.1.2-SNAPSHOT ?
> 
> That's what I'm wanting to do, I just can't work out where to get it. I naively put
> 4.1.2-SNAPSHOT
> as my karaf version in the pom, but it doesn't find it, as I presumably need to point at a snapshot repository somewhere. That was really my question. What URL should I use for the snapshot URL?
> 
> Thanks.
> 

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

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Posted by to...@quarendon.net.
> On 13 June 2017 at 15:50 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> 
> Do you have a chance to test with 4.1.2-SNAPSHOT ?

That's what I'm wanting to do, I just can't work out where to get it. I naively put 
4.1.2-SNAPSHOT
as my karaf version in the pom, but it doesn't find it, as I presumably need to point at a snapshot repository somewhere. That was really my question. What URL should I use for the snapshot URL? 

Thanks.

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Do you have a chance to test with 4.1.2-SNAPSHOT ?

Thanks !
Regards
JB

On 06/13/2017 04:44 PM, tom@quarendon.net wrote:
> 
>> On 13 June 2017 at 15:02 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>>
>> Hi Tom
>>
>> It has been fixed and will be included in 4.1.2.
>>
> Ah, good. 4.1 seems unusable as far as I can see otherwise.
> 
> I've been looking around, but I can't find where I might get a snapshot build from, what repository I would need to point at?
> 
> Sorry for all the questions. I have more!
> Thanks.
> 

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

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Posted by to...@quarendon.net.
Windows, yes.

> On 13 June 2017 at 15:51 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> 
> By the way, are you on Windows ?
> 
> Regards
> JB
> 
> On 06/13/2017 04:44 PM, tom@quarendon.net wrote:
> > 
> >> On 13 June 2017 at 15:02 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> >>
> >>
> >> Hi Tom
> >>
> >> It has been fixed and will be included in 4.1.2.
> >>
> > Ah, good. 4.1 seems unusable as far as I can see otherwise.
> > 
> > I've been looking around, but I can't find where I might get a snapshot build from, what repository I would need to point at?
> > 
> > Sorry for all the questions. I have more!
> > Thanks.
> > 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way, are you on Windows ?

Regards
JB

On 06/13/2017 04:44 PM, tom@quarendon.net wrote:
> 
>> On 13 June 2017 at 15:02 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>>
>> Hi Tom
>>
>> It has been fixed and will be included in 4.1.2.
>>
> Ah, good. 4.1 seems unusable as far as I can see otherwise.
> 
> I've been looking around, but I can't find where I might get a snapshot build from, what repository I would need to point at?
> 
> Sorry for all the questions. I have more!
> Thanks.
> 

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

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

Posted by to...@quarendon.net.
> On 13 June 2017 at 15:02 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> 
> Hi Tom
> 
> It has been fixed and will be included in 4.1.2.
> 
Ah, good. 4.1 seems unusable as far as I can see otherwise.

I've been looking around, but I can't find where I might get a snapshot build from, what repository I would need to point at?

Sorry for all the questions. I have more!
Thanks.

Re: Karaf termination caused by typing something incorrect on the gogo shell in 4.1.1

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

It has been fixed and will be included in 4.1.2.

Regards
JB

On 06/13/2017 03:51 PM, tom@quarendon.net wrote:
> Start up Karaf with the "bin/karaf.bat" shell script.
> 
> At the console type
> help bundle:info
> You get:
> gogo: NullPointerException: "in" is null!
> 
> If I run this from the official 4.1.1 install, it looks like this is trying to "more" the help contents or something. I get a colon, and if you press q it goes back to the prompt. You get no help output though. If I do the same on 4.0.6, I get paginated help out, so something has changed there.
> 
> Run this from a "custom assembly" consisting of the "standard" feature, and I get:
> 
> 
> 2017-06-13T14:33:11,173 | ERROR | Karaf local console user karaf | ShellUtil                        | 55 - org.apache.karaf.shell.core - 4.1.1 | Exception caught while executing command
> java.lang.NumberFormatException: For input string: "43B"
> 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
> 	at java.lang.Integer.parseInt(Integer.java:580) [?:?]
> 	at java.lang.Integer.<init>(Integer.java:867) [?:?]
> 	at org.fusesource.jansi.AnsiOutputStream.write(AnsiOutputStream.java:122) [86:org.fusesource.jansi:1.14.0]
> 	at java.io.FilterOutputStream.write(FilterOutputStream.java:125) [?:?]
> 	at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:458) [?:?]
> 	at org.apache.felix.gogo.runtime.Pipe$MultiChannel.write(Pipe.java:644) [55:org.apache.karaf.shell.core:4.1.1]
> 	at java.nio.channels.Channels.writeFullyImpl(Channels.java:78) [?:?]
> 	at java.nio.channels.Channels.writeFully(Channels.java:101) [?:?]
> 	at java.nio.channels.Channels.access$000(Channels.java:61) [?:?]
> 	at java.nio.channels.Channels$1.write(Channels.java:174) [?:?]
> 	at java.io.PrintStream.write(PrintStream.java:480) [?:?]
> 	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) [?:?]
> 	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291) [?:?]
> 	at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104) [?:?]
> 	at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185) [?:?]
> 	at java.io.PrintStream.write(PrintStream.java:527) [?:?]
> 	at java.io.PrintStream.print(PrintStream.java:669) [?:?]
> 	at java.io.PrintStream.println(PrintStream.java:806) [?:?]
> 	at org.apache.felix.gogo.jline.Posix._main(Posix.java:128) [55:org.apache.karaf.shell.core:4.1.1]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
> 	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
> 	at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:136) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.karaf.shell.impl.console.SessionFactoryImpl$ShellCommand.lambda$wrap$0(SessionFactoryImpl.java:195) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.karaf.shell.impl.console.SessionFactoryImpl$ShellCommand$$Lambda$37/1313854807.execute(Unknown Source) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.karaf.shell.impl.console.SessionFactoryImpl$ShellCommand.execute(SessionFactoryImpl.java:241) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:560) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:486) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:375) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [55:org.apache.karaf.shell.core:4.1.1]
> 	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [55:org.apache.karaf.shell.core:4.1.1]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
> 	at java.lang.Thread.run(Thread.java:745) [?:?]
> 2017-06-13T14:33:11,177 | ERROR | Karaf local console user karaf | ShellUtil                        | 55 - org.apache.karaf.shell.core - 4.1.1 | Exception caught while executing command
> java.lang.NumberFormatException: For input string: "43BF"
> 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
> 	at java.lang.Integer.parseInt(Integer.java:580) [?:?]
> 	at java.lang.Integer.<init>(Integer.java:867) [?:?]
> 	at org.fusesource.jansi.AnsiOutputStream.write(AnsiOutputStream.java:122) [86:org.fusesource.jansi:1.14.0]
> 	at java.io.FilterOutputStream.write(FilterOutputStream.java:125) [?:?]
> 	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) [?:?]
> 	at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282) [?:?]
> 	at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125) [?:?]
> 	at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135) [?:?]
> 	at java.io.OutputStreamWriter.write(OutputStreamWriter.java:220) [?:?]
> 	at java.io.PrintWriter.write(PrintWriter.java:456) [?:?]
> 	at java.io.PrintWriter.write(PrintWriter.java:473) [?:?]
> 	at org.jline.utils.Display.rawPrint(Display.java:490) [87:org.jline:3.2.0]
> 	at org.jline.utils.Display.update(Display.java:253) [87:org.jline:3.2.0]
> 	at org.jline.reader.impl.LineReaderImpl.redisplay(LineReaderImpl.java:3361) [87:org.jline:3.2.0]
> 	at org.jline.reader.impl.LineReaderImpl.cleanup(LineReaderImpl.java:2195) [87:org.jline:3.2.0]
> 	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:567) [87:org.jline:3.2.0]
> 	at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:339) [55:org.apache.karaf.shell.core:4.1.1]
> 	at java.lang.Thread.run(Thread.java:745) [?:?]
> 
> followed (eventually) by program termination.
> 
> I'm running on Windows if it makes a difference.
> I try the same with 4.0.6 and in both cases I get paginated help output.
> A difference is that it doesn't attempt to highlight the commands as you type them, which on Windows renders them unreadable anyway, since the console is black. Is this related to that?
> 
> Is this a known problem with 4.1?
> 
> Thanks.
> 

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