I am seeing some exceptions being thrown from Tomcat NIO when this is enabled in DWR. It appears these exceptions result from the fact that we are closing the CometEvent before we flush in the Script Conduit:
g to response: dwr.util.setValue("clockDisplay","Sun Apr 17 12:22:32 MDT 2011",{
escapeHtml:false});
java.lang.NullPointerException
at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioO
utputBuffer.java:621)
at org.apache.coyote.http11.InternalNioOutputBuffer.access$000(InternalN
ioOutputBuffer.java:46)
at org.apache.coyote.http11.InternalNioOutputBuffer$SocketOutputBuffer.d
oWrite(InternalNioOutputBuffer.java:809)
at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedO
utputFilter.java:124)
at org.apache.coyote.http11.InternalNioOutputBuffer.doWrite(InternalNioO
utputBuffer.java:590)
at org.apache.coyote.Response.doWrite(Response.java:560)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffe
r.java:353)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:
309)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:28
8)
at org.apache.catalina.connector.CoyoteWriter.flush(CoyoteWriter.java:95
)
at org.directwebremoting.dwrp.BaseScriptConduit.flush(BaseScriptConduit.
java:143)
at org.directwebremoting.dwrp.PlainScriptConduit.addScript(PlainScriptCo
nduit.java:102)
at org.directwebremoting.impl.DefaultScriptSession.addScript(DefaultScri
ptSession.java:240)
at org.directwebremoting.ScriptSessions.addScript(ScriptSessions.java:81
)
at org.directwebremoting.ScriptSessions.addFunctionCall(ScriptSessions.j
ava:115)
at org.directwebremoting.ui.dwr.Util.setValue(Util.java:63)
at org.directwebremoting.ui.dwr.Util.setValue(Util.java:51)
at com.example.dwr.reverseajax.Clock$1.run(Clock.java:93)
at org.directwebremoting.impl.DefaultTaskDispatcher.dispatchTask(Default
TaskDispatcher.java:57)
at org.directwebremoting.Browser.withPage(Browser.java:141)
at com.example.dwr.reverseajax.Clock.setClockDisplay(Clock.java:89)
at com.example.dwr.reverseajax.Clock.run(Clock.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
As far as I can tell this never actually worked, see
DWR-423. The issue in 423 was actually preventing the Tomcat specific stuff from firing.DWR-423. The issue in 423 was actually preventing the Tomcat specific stuff from firing.