mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erinc Arikan <erincari...@gmail.com>
Subject Re: NullPointerException in ProtocolCodecFilter
Date Thu, 29 Apr 2010 22:24:09 GMT
I thought it was handling that case, but in my application it was failing to
do so. Your issue might be different than mine, but I think that, still it's
worth looking at.

Erinc

On Thu, Apr 29, 2010 at 6:21 PM, dev@xx <dev@proxiflex.fr> wrote:

> Thanks, I will try to reproduce the error with this info.
>
> Does Mina should not handle this situation ?
>
> JY
>
> ----- Original Message ----- From: "Erinc Arikan" <erincarikan@gmail.com>
> To: <users@mina.apache.org>
> Sent: Friday, April 30, 2010 12:07 AM
> Subject: Re: NullPointerException in ProtocolCodecFilter
>
>
>
>  I've seen similar errors with my application too, Generally it happens, if
>> client closes the connection before you write into the session.
>>
>> If I were you, I'd check if that's the case.
>>
>> Erinc
>>
>> On Thu, Apr 29, 2010 at 6:02 PM, dev@xx <dev@proxiflex.fr> wrote:
>>
>>  One of my customers has very rare exceptions like this and I can't find
>>> any
>>> explanation in my code :
>>>
>>> org.apache.mina.filter.codec.ProtocolEncoderException:
>>> java.lang.NullPointerException
>>> at
>>>
>>> org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:313)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:506)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:46)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:805)
>>> at
>>>
>>> org.apache.mina.filter.executor.ExecutorFilter.filterWrite(ExecutorFilter.java:706)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:506)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:46)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:805)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:731)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:506)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:498)
>>> at
>>>
>>> org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:428)
>>> at
>>>
>>> org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:369)
>>> at
>>>
>>> fr.proxiflex.axx.server.HTTPReceivedHandler.handleMessage(HTTPReceivedHandler.java:38)
>>> at
>>>
>>> org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:232)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
>>> at
>>>
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
>>> at
>>>
>>> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:71)
>>> at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
>>> at
>>>
>>> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:780)
>>> at
>>>
>>> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:772)
>>> at
>>>
>>> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:714)
>>> at java.lang.Thread.run(Thread.java:619)
>>> Caused by: java.lang.NullPointerException
>>> at
>>>
>>> org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:298)
>>> ... 24 more
>>>
>>> Anybody have any idea of what it can come from ?
>>> I can give more information if necessary, but the exception seams to be
>>> internal to Mina.
>>>
>>> In case, the HTTPReceivedHandler code is :
>>>
>>> public class HTTPReceivedHandler implements MessageHandler
>>> {
>>>  private String root ;
>>>
>>>   public HTTPReceivedHandler( String root )
>>>   {
>>>  Log.info( "root=" + root ) ;
>>>  this.root = root ;
>>>  }
>>>
>>>  @Override
>>>  public void handleMessage( IoSession session, Object message ) throws
>>> Exception
>>>  {
>>>  Log.trace( "R" ) ;
>>>  HTTPMessage msg = (HTTPMessage)message ;
>>>  Log.received( msg ) ;
>>>  msg.execute( root ) ;
>>>  session.write( msg ) ;    // <<<< line 38
>>>  }
>>>
>>> }
>>>
>>> Thanks
>>>
>>> Jean-Yves Linet
>>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message