users@grizzly.java.net

Re: Exception in load testing

From: Jon Brisbin <jon_at_jbrisbin.com>
Date: Wed, 20 Jul 2011 11:55:12 -0500

On Jul 20, 2011, at 11:15 AM, Oleksiy Stashok wrote:

> On 07/20/2011 06:10 PM, Jon Brisbin wrote:
>> On Jul 20, 2011, at 11:03 AM, Oleksiy Stashok wrote:
>>
>>> Which Grizzly version are you using? Is it one taken from the trunk or 2.1.1?
>> 2.1.1
> Please try to checkout Grizzly 2.0 code from trunk (version 2.1.2-SNAPSHOT) and test it?

Ugh. Ok, if you think it'll help.

I'm also getting this on a response.resume() when streaming from a FileChannel to the browser:

Jul 20, 2011 11:52:22 AM org.glassfish.grizzly.filterchain.DefaultFilterChain execute
WARNING: Exception during FilterChain execution
java.lang.NullPointerException
        at org.glassfish.grizzly.memory.ByteBufferWrapper.remaining(ByteBufferWrapper.java:209)
        at org.glassfish.grizzly.memory.BuffersBuffer.calcCapacity(BuffersBuffer.java:1568)
        at org.glassfish.grizzly.memory.BuffersBuffer.prepend(BuffersBuffer.java:227)
        at org.glassfish.grizzly.memory.BuffersBuffer.prepend(BuffersBuffer.java:57)
        at org.glassfish.grizzly.memory.Buffers.appendBuffers(Buffers.java:405)
        at org.glassfish.grizzly.http.HttpCodecFilter.encodeHttpPacket(HttpCodecFilter.java:664)
        at org.glassfish.grizzly.http.HttpServerFilter.encodeHttpPacket(HttpServerFilter.java:366)
        at org.glassfish.grizzly.http.HttpCodecFilter.handleWrite(HttpCodecFilter.java:526)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$4.execute(ExecutorResolver.java:104)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:444)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:364)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:290)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:133)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:76)
        at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:547)
        at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:527)
        at org.glassfish.grizzly.http.server.io.OutputBuffer.writeContentChunk(OutputBuffer.java:571)
        at org.glassfish.grizzly.http.server.io.OutputBuffer.close(OutputBuffer.java:385)
        at org.glassfish.grizzly.http.server.io.OutputBuffer.endRequest(OutputBuffer.java:230)
        at org.glassfish.grizzly.http.server.Response.finish(Response.java:505)
        at org.glassfish.grizzly.http.server.HttpServerFilter.afterService(HttpServerFilter.java:279)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$3.execute(ExecutorResolver.java:95)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:444)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:364)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:290)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:133)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:76)
        at org.glassfish.grizzly.filterchain.FilterChainContext$1.run(FilterChainContext.java:198)
        at org.glassfish.grizzly.filterchain.FilterChainContext.resume(FilterChainContext.java:222)
        at org.glassfish.grizzly.http.server.Response.resume(Response.java:1585)
        at org.glassfish.grizzly.http.server.Response$resume.call(Unknown Source)
        at [SNIP]
        at sun.nio.ch.FileChannelImpl.transferToArbitraryChannel(FileChannelImpl.java:465)
        at sun.nio.ch.FileChannelImpl.transferTo(FileChannelImpl.java:514)
        at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrap.invoke(PojoMetaMethodSite.java:210)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at [SNIP]
        at [SNIP]
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:162)
        at org.glassfish.grizzly.http.server.HttpHandlerChain.service(HttpHandlerChain.java:195)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:162)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:160)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$3.execute(ExecutorResolver.java:95)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:444)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:364)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:290)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:133)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:76)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:63)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:823)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
        at org.glassfish.grizzly.strategies.SameThreadIOStrategy.executeIoEvent(SameThreadIOStrategy.java:96)
        at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:398)
        at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:366)
        at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:332)
        at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:268)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:508)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:488)
        at java.lang.Thread.run(Thread.java:680)

jb

>
> Thanks.
>
> WBR,
> Alexey.
>
>
>>> Again would be easier, if I'd be able to reproduce this on a simple test.
>> Yeah, I know that would be a lot simpler. Unfortunately I'm trying to keep up with another group that's doing something similar and I don't have a lot of time to extract the appropriate bits of this application and put them into separate test.
>>
>> I was kinda hoping someone might recognize the error and say "adjust this knob and you'll be all set". :)
>>
>> I'm using HttpServer.createSimpleServer() and registering a single HttpHandler implementation that accepts HTTP uploads and streams them to a FileChannel object using the NIOInputStream to read from the client, if it makes any difference.
>>
>> If I have time, I'll try and break this stuff out into a test case...
>>
>> jb
>>
>>
>>> Thanks.
>>>
>>> WBR,
>>> Alexey.
>>>
>>>> Thanks!
>>>>
>>>> Jon Brisbin
>>>>
>>>> http://jbrisbin.com
>>>> Twitter: @j_brisbin
>>>>
>>>>
>>
>> Thanks!
>>
>> Jon Brisbin
>>
>> http://jbrisbin.com
>> Twitter: @j_brisbin
>>
>>
>


Thanks!

Jon Brisbin

http://jbrisbin.com
Twitter: @j_brisbin