NPE in

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

NPE in

Farzad Panahi

I am trying to figure out an issue I have with Tyrus (which is using grizzly). Basically what is happening is that Tyrus fails to reconnect to websocket server if server restarts. The underlying issue from grizzly side is a NPE thrown at if (runners.length == 1) {  in

private final class SharedIterator implements Iterator {
private final AtomicInteger counter = new AtomicInteger();

public SelectorRunner next() {
    final SelectorRunner[] runners = getTransportSelectorRunners();
    if (runners.length == 1) {
        return runners[0];

    return runners[(counter.getAndIncrement() & 0x7fffffff) % runners.length];

public SelectorRunner nextService() {
    return next();
Looks like for some reason runners becomes null. Anyone has any idea when and why selector runners may become null?