At first glance, my guess is because the session output stream uses connection.write() vs filterchaincontext.write() we lose the original context that the port unification is looking for and hence the NPE.
@rlubke Commented
We're not going to address this issue for 2.4. Grizzly 3.0 has a connection-based port unification approach vs request/response as is done in 2.4. We'll document this decision.
See https://github.com/javaee/glassfish/issues/21764.
At first glance, my guess is because the session output stream uses connection.write() vs filterchaincontext.write() we lose the original context that the port unification is looking for and hence the NPE.