Menu

#11 null exception using epectErr and Jsch channel

open
nobody
None
5
2011-06-10
2011-06-10
john
No

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)

Discussion


Log in to post a comment.

MongoDB Logo MongoDB