null exception using epectErr and Jsch channel
Brought to you by:
johanwalles,
kerneldebugger
Using version 2.0.7,
Code snippet:
ExpectJ expect = new ExpectJ(3);
ChannelShell channelShell = ...
Spawn shell = expect.spawn(channelShell);
...
shell.expectErr("ANY TEXT", 3);
Apparently, using a Jsch channelShell does not initialize the standard err selector. It is null:
Exception in thread "main" java.lang.NullPointerException
at expectj.Spawn.expect(Spawn.java:284)
at expectj.Spawn.expectErr(Spawn.java:358)