users@grizzly.java.net

Re: strange exception

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 15 Sep 2008 11:33:46 -0400

Salut,

I've fixed the issue last friday:

> Author: jfarcand
> Date: 2008-09-12 14:51:13+0000
> New Revision: 1507
>
> Modified:
> trunk/modules/http/src/main/java/com/sun/grizzly/arp/AsyncProtocolFilter.java
> trunk/modules/http/src/main/java/com/sun/grizzly/arp/DefaultAsyncExecutor.java
>
> Log:
> Fix for https://grizzly.dev.java.net/issues/show_bug.cgi?id=253
> ("https://grizzly.dev.java.net/issues/show_bug.cgi?id=253")
>
> When the FileCache is enabled, a static resource might be serviced directly when the DefaultAsyncExecutor.preExecute() is called, the finsh operation will be initiated but another thread might also decide to finish the operation, hence a thread race when calling AsyncProtocolFilter. The side effect is the ProcessorTask.recycle() can be called more than once, which will cause the SelectionKey to becomes null and create the regression noted by Mark.
>
>

Can you try the 1.8.6-SNAPSHOT?

Thanks!

-- Jeanfrancois

Oleksiy Stashok wrote:
> Hi,
>
> it's similar issue with the one, which has Mark Hig "New null pointer
> error".
> I will let Jeanfrancois to check this. Because not sure wether we have
> to add simple check of SelectionKey != null, or problem is deeper.
>
> Thank you.
>
> WBR,
> Alexey.
>
> On Sep 13, 2008, at 13:51 , Cam Bazz wrote:
>
>> Hello,
>>
>> I get (only sometimes)
>>
>> The log message is null.
>> java.lang.NullPointerException
>> at
>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.registerKey(DefaultReadTask.java:438)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.AsyncReadTask.terminate(AsyncReadTask.java:174)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.taskEvent(DefaultReadTask.java:365)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.TaskBase.fireTaskEvent(TaskBase.java:234)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.terminateProcess(DefaultProcessorTask.java:792)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.postExecute(DefaultAsyncExecutor.java:191)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:99)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.flushResponse(CometEngine.java:534)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.resume(CometEngine.java:521)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometContext.resumeCometHandler(CometContext.java:433)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometContext.resumeCometHandler(CometContext.java:399)
>>
>> at handlers.StatsHandler.onEvent(StatsHandler.java:30)
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.DefaultNotificationHandler.notify0(DefaultNotificationHandler.java:188)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.DefaultNotificationHandler.notify0(DefaultNotificationHandler.java:113)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.DefaultNotificationHandler$1.doTask(DefaultNotificationHandler.java:102)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
>> at
>> com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
>>
>> Notification failed:
>> java.lang.RuntimeException: java.lang.NullPointerException
>> at
>> com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:110)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.flushResponse(CometEngine.java:534)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometEngine.resume(CometEngine.java:521)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometContext.resumeCometHandler(CometContext.java:433)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.CometContext.resumeCometHandler(CometContext.java:399)
>>
>> at handlers.StatsHandler.onEvent(StatsHandler.java:30)
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.DefaultNotificationHandler.notify0(DefaultNotificationHandler.java:188)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.DefaultNotificationHandler.notify0(DefaultNotificationHandler.java:113)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.comet.DefaultNotificationHandler$1.doTask(DefaultNotificationHandler.java:102)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
>> at
>> com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
>>
>> Caused by: java.lang.NullPointerException
>> at
>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.registerKey(DefaultReadTask.java:438)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.AsyncReadTask.terminate(AsyncReadTask.java:174)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.taskEvent(DefaultReadTask.java:365)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.TaskBase.fireTaskEvent(TaskBase.java:234)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.terminateProcess(DefaultProcessorTask.java:792)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.postExecute(DefaultAsyncExecutor.java:191)
>>
>> at
>> com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:99)
>>
>> ... 10 more
>>
>> It is triggered at event.getCometContext().resumeCometHandler(this) from:
>>
>> public void onEvent(CometEvent event) throws IOException {
>> if(CometEvent.NOTIFY == event.getType()) {
>> PrintWriter writer = response.getWriter();
>> String[] attachment = (String[]) event.attachment();
>> response.addHeader("X-CON", attachment[0]);
>> response.addHeader("X-UNQ", attachment[1]);
>> response.addHeader("X-LVE", attachment[2]);
>> writer.write("success");
>> writer.flush();
>> event.getCometContext().resumeCometHandler(this);
>> }
>> }
>>
>> any ideas?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>