You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Mark Webb <el...@gmail.com> on 2008/12/03 20:11:24 UTC
Asyncweb error
I am working on writing a simple web server application using the
asyncweb library. I am getting the following error. I am using
Google Chrome to test the server. I do get the proper response in the
browser but I also see this exception in the output of the server.
java.lang.IllegalArgumentException: No enum const class
org.apache.asyncweb.common.HttpMethod.
at java.lang.Enum.valueOf(Enum.java:192)
at org.apache.asyncweb.common.HttpMethod.valueOf(HttpMethod.java:1)
at org.apache.asyncweb.common.codec.HttpRequestLineDecodingState$1.finishDecode(HttpRequestLineDecodingState.java:66)
at org.apache.mina.filter.codec.statemachine.ConsumeToDynamicTerminatorDecodingState.finishDecode(ConsumeToDynamicTerminatorDecodingState.java:103)
at org.apache.mina.filter.codec.statemachine.DecodingStateMachine.finishDecode(DecodingStateMachine.java:151)
at org.apache.mina.filter.codec.statemachine.DecodingStateMachine.finishDecode(DecodingStateMachine.java:151)
at org.apache.mina.filter.codec.statemachine.DecodingStateProtocolDecoder.finishDecode(DecodingStateProtocolDecoder.java:100)
at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:258)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:378)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:49)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:817)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:87)
at org.apache.mina.filter.logging.MdcInjectionFilter.filter(MdcInjectionFilter.java:137)
at org.apache.mina.filter.util.CommonEventFilter.sessionClosed(CommonEventFilter.java:55)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:378)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:49)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:817)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:87)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:64)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:551)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:543)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:487)
at java.lang.Thread.run(Thread.java:619)
[13:50:47] DEBUG [DecodingStateMachine ] Ignoring the exception
caused by a closed session.
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.apache.asyncweb.common.codec.HttpRequestDecodingStateMachine$2.finishDecode(HttpRequestDecodingStateMachine.java:97)
at org.apache.mina.filter.codec.statemachine.DecodingStateMachine.finishDecode(DecodingStateMachine.java:168)
at org.apache.mina.filter.codec.statemachine.DecodingStateMachine.finishDecode(DecodingStateMachine.java:151)
at org.apache.mina.filter.codec.statemachine.DecodingStateProtocolDecoder.finishDecode(DecodingStateProtocolDecoder.java:100)
at org.apache.mina.filter.codec.ProtocolCodecFilter.sessionClosed(ProtocolCodecFilter.java:258)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:378)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:49)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:817)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:87)
at org.apache.mina.filter.logging.MdcInjectionFilter.filter(MdcInjectionFilter.java:137)
at org.apache.mina.filter.util.CommonEventFilter.sessionClosed(CommonEventFilter.java:55)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionClosed(DefaultIoFilterChain.java:378)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$900(DefaultIoFilterChain.java:49)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionClosed(DefaultIoFilterChain.java:817)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:87)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:64)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:551)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:543)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:487)
at java.lang.Thread.run(Thread.java:619)
Re: Asyncweb error
Posted by Emmanuel Lecharny <el...@gmail.com>.
Mark Webb wrote:
> I am seeing the same error with wget as well. I think I have narrowed
> down the problem. In the class HttpRequestLineDecodingState line 67
> you have an IoBuffer that represents the request. There is then the
> following line of code:
>
> HttpMethod method = HttpMethod.valueOf(product.getString(asciiDecoder));
>
It's slightly more complex... AsyncWeb is using a system which split the
IoBuffer in many small IoBuffers,
in this case using the 0x20 as a separator. So the product.getString()
method should work on an IoBuffer containing only '47 45 54' (ie, GET).
If it's not, then there is something wrong somewhere else.
Do you have a starting point where we can start debugging your issue ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: Asyncweb error
Posted by Mark Webb <el...@gmail.com>.
I am seeing the same error with wget as well. I think I have narrowed
down the problem. In the class HttpRequestLineDecodingState line 67
you have an IoBuffer that represents the request. There is then the
following line of code:
HttpMethod method = HttpMethod.valueOf(product.getString(asciiDecoder));
When I print out the variable "product" using a hex dumper, I get the following:
0000: 47 45 54 20 2F 72 73 73 20 48 54 54 50 2F 31 2E GET /rss HTTP/1.
0010: 30 0D 0A 55 73 65 72 2D 41 67 65 6E 74 3A 20 57 0..User-Agent: W
0020: 67 65 74 2F 31 2E 31 31 2E 33 0D 0A 41 63 63 65 get/1.11.3..Acce
0030: 70 74 3A 20 2A 2F 2A 0D 0A 48 6F 73 74 3A 20 6C pt: */*..Host: l
0040: 6F 63 61 6C 68 6F 73 74 3A 39 30 31 32 0D 0A 43 ocalhost:9012..C
0050: 6F 6E 6E 65 63 74 69 6F 6E 3A 20 4B 65 65 70 2D onnection: Keep-
0060: 41 6C 69 76 65 0D 0A 0D 0A 00 00 00 00 00 00 00 Alive...........
0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
The rest is all zero and the buffer is 2048 bytes. I might be off on
this, but I am not sure we want to pass in a 2048 byte IoBuffer to
valueOf in order to get a result back.
--Mark
On Wed, Dec 3, 2008 at 2:50 PM, Mark Webb <el...@gmail.com> wrote:
> Just tried Firefox and saw the exception.
>
> On Wed, Dec 3, 2008 at 2:46 PM, Mark Webb <el...@gmail.com> wrote:
>> hrmm... Shouldn't it be a GET? I am just typing in the URL and
>> pressing the <enter> key. I tried Internet Exploder and Google Chrome
>> and got the same results.
>>
>>
>> On Wed, Dec 3, 2008 at 2:41 PM, Emmanuel Lecharny <el...@gmail.com> wrote:
>>> Mark Webb wrote:
>>>>
>>>> Here is what the browser prints out. I am now using the listener
>>>> example and getting the same exception.
>>>>
>>>> ----------------------------------------------------------
>>>> You sent these headers with your request:
>>>> Accept =
>>>> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>>>> Accept-Charset = ISO-8859-1,*,utf-8
>>>> Accept-Encoding = gzip,deflate,bzip2,sdch
>>>> Accept-Language = en-US,en
>>>> Connection = Keep-Alive
>>>> Host = localhost:9012
>>>> User-Agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
>>>> AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.29 Safari/525.19
>>>> X-SDCH = Chrome 0.4.154.29
>>>> ----------------------------------------------------------
>>>>
>>>
>>> from the stack trace you posted, the error is due to a wrong http method (it
>>> should be OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE or CONNECT). What is
>>> the method you are using ?
>>>
>>> --
>>> --
>>> cordialement, regards,
>>> Emmanuel Lécharny
>>> www.iktek.com
>>> directory.apache.org
>>>
>>>
>>>
>>
>
Re: Asyncweb error
Posted by Mark Webb <el...@gmail.com>.
Just tried Firefox and saw the exception.
On Wed, Dec 3, 2008 at 2:46 PM, Mark Webb <el...@gmail.com> wrote:
> hrmm... Shouldn't it be a GET? I am just typing in the URL and
> pressing the <enter> key. I tried Internet Exploder and Google Chrome
> and got the same results.
>
>
> On Wed, Dec 3, 2008 at 2:41 PM, Emmanuel Lecharny <el...@gmail.com> wrote:
>> Mark Webb wrote:
>>>
>>> Here is what the browser prints out. I am now using the listener
>>> example and getting the same exception.
>>>
>>> ----------------------------------------------------------
>>> You sent these headers with your request:
>>> Accept =
>>> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>>> Accept-Charset = ISO-8859-1,*,utf-8
>>> Accept-Encoding = gzip,deflate,bzip2,sdch
>>> Accept-Language = en-US,en
>>> Connection = Keep-Alive
>>> Host = localhost:9012
>>> User-Agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
>>> AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.29 Safari/525.19
>>> X-SDCH = Chrome 0.4.154.29
>>> ----------------------------------------------------------
>>>
>>
>> from the stack trace you posted, the error is due to a wrong http method (it
>> should be OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE or CONNECT). What is
>> the method you are using ?
>>
>> --
>> --
>> cordialement, regards,
>> Emmanuel Lécharny
>> www.iktek.com
>> directory.apache.org
>>
>>
>>
>
Re: Asyncweb error
Posted by Mark Webb <el...@gmail.com>.
hrmm... Shouldn't it be a GET? I am just typing in the URL and
pressing the <enter> key. I tried Internet Exploder and Google Chrome
and got the same results.
On Wed, Dec 3, 2008 at 2:41 PM, Emmanuel Lecharny <el...@gmail.com> wrote:
> Mark Webb wrote:
>>
>> Here is what the browser prints out. I am now using the listener
>> example and getting the same exception.
>>
>> ----------------------------------------------------------
>> You sent these headers with your request:
>> Accept =
>> text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
>> Accept-Charset = ISO-8859-1,*,utf-8
>> Accept-Encoding = gzip,deflate,bzip2,sdch
>> Accept-Language = en-US,en
>> Connection = Keep-Alive
>> Host = localhost:9012
>> User-Agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
>> AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.29 Safari/525.19
>> X-SDCH = Chrome 0.4.154.29
>> ----------------------------------------------------------
>>
>
> from the stack trace you posted, the error is due to a wrong http method (it
> should be OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE or CONNECT). What is
> the method you are using ?
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
Re: Asyncweb error
Posted by Emmanuel Lecharny <el...@gmail.com>.
Mark Webb wrote:
> Here is what the browser prints out. I am now using the listener
> example and getting the same exception.
>
> ----------------------------------------------------------
> You sent these headers with your request:
> Accept = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> Accept-Charset = ISO-8859-1,*,utf-8
> Accept-Encoding = gzip,deflate,bzip2,sdch
> Accept-Language = en-US,en
> Connection = Keep-Alive
> Host = localhost:9012
> User-Agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
> AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.29 Safari/525.19
> X-SDCH = Chrome 0.4.154.29
> ----------------------------------------------------------
>
from the stack trace you posted, the error is due to a wrong http method
(it should be OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE or CONNECT).
What is the method you are using ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: Asyncweb error
Posted by Mark Webb <el...@gmail.com>.
Here is what the browser prints out. I am now using the listener
example and getting the same exception.
----------------------------------------------------------
You sent these headers with your request:
Accept = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Charset = ISO-8859-1,*,utf-8
Accept-Encoding = gzip,deflate,bzip2,sdch
Accept-Language = en-US,en
Connection = Keep-Alive
Host = localhost:9012
User-Agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.29 Safari/525.19
X-SDCH = Chrome 0.4.154.29
----------------------------------------------------------
On Wed, Dec 3, 2008 at 2:29 PM, Emmanuel Lecharny <el...@gmail.com> wrote:
> Mark Webb wrote:
>>
>> I am working on writing a simple web server application using the
>> asyncweb library. I am getting the following error. I am using
>> Google Chrome to test the server. I do get the proper response in the
>> browser but I also see this exception in the output of the server.
>>
>
> What is the request the server is receiving ?
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
Re: Asyncweb error
Posted by Emmanuel Lecharny <el...@gmail.com>.
Mark Webb wrote:
> I am working on writing a simple web server application using the
> asyncweb library. I am getting the following error. I am using
> Google Chrome to test the server. I do get the proper response in the
> browser but I also see this exception in the output of the server.
>
What is the request the server is receiving ?
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org