Hi -
I've downloaded the recent 1.1 snapshot and I'm trying to use the
Grizzly connector. Everything is working just fine for GETs but
POSTs are causing me some problems.
When I call Request.getEntitiyAsForm, I get the following exception:
[java] java.nio.channels.IllegalBlockingModeException
[java] at sun.nio.ch.ChannelInputStream.read
(ChannelInputStream.java:39)
[java] at sun.nio.ch.ChannelInputStream.read
(ChannelInputStream.java:92)
[java] at sun.nio.ch.ChannelInputStream.read
(ChannelInputStream.java:86)
[java] at java.io.InputStream.read(InputStream.java:89)
[java] at sun.nio.ch.ChannelInputStream.read
(ChannelInputStream.java:64)
[java] at
com.noelios.restlet.util.FormReader.readNextParameter(FormReader.java:
231)
[java] at com.noelios.restlet.util.FormReader.addParameters
(FormReader.java:308)
[java] at com.noelios.restlet.util.FormUtils.parsePost
(FormUtils.java:92)
[java] at com.noelios.restlet.Engine.parse(Engine.java:822)
[java] at org.restlet.data.Form.<init>(Form.java:74)
[java] at org.restlet.data.Form.<init>(Form.java:100)
[java] at org.restlet.data.Message.getEntityAsForm
(Message.java:156)
From my reading about NIO, this is caused when something tries to go
from blocking to non-blocking or the other way around.
Just using Request.getEntity returns a ReadableRepresentation from
which I can get a ReadableByteChannel. I thought I could read that
into a ByteBuffer and at least see the query params. Unfortunately,
I'm not able to access them. Granted I'm probably trying to access
them incorrectly but I'm reading the buffer and writing it out to a
ByteArrayOutputStream via a WritableByteChannel.
Anyone have any thoughts or ideas?
thanks,
josh