Quantcast

NPE in RoundRobinConnectionDistributor.java:146

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

NPE in RoundRobinConnectionDistributor.java:146

Farzad Panahi
Hi, 

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 RoundRobinConnectionDistributor.java:146

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

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

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

@Override
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? 

Cheers

Farzad
Loading...