Re: RIAP cannot handle binary streams

2010-12-07 Thread Tal Liron
Anybody?

I sometimes think I'm the only Restlet user who pushes RIAP to these
extremes... :)

On Sun, Nov 21, 2010 at 11:24 PM, Tal Liron tal.li...@threecrickets.comwrote:

 I have an representation that writes binary data. It works fine in HTTP,
 but in RIAP I get this exception when I try to exhaust the stream (Restlet
 2.0.2):


  java.io.IOException: Timeout while reading from the queue-based input
 stream
at org.restlet.engine.io.PipeStream$1.read(PipeStream.java:78)
at java.io.InputStream.read(InputStream.java:171)
at java.io.InputStream.read(InputStream.java:102)
at org.restlet.engine.io.BioUtils.exhaust(BioUtils.java:220)
at
 org.restlet.representation.Representation.exhaust(Representation.java:322)


 Is this a bug, or am I doing something unsupported?

 -Tal


--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2688559

Re: RIAP cannot handle binary streams

2010-12-07 Thread Tim Peierls
I'll try it.

On Tue, Dec 7, 2010 at 3:30 PM, Tal Liron tal.li...@threecrickets.comwrote:

 Anybody?

 I sometimes think I'm the only Restlet user who pushes RIAP to these
 extremes... :)


 On Sun, Nov 21, 2010 at 11:24 PM, Tal Liron 
 tal.li...@threecrickets.comwrote:

 I have an representation that writes binary data. It works fine in HTTP,
 but in RIAP I get this exception when I try to exhaust the stream (Restlet
 2.0.2):


  java.io.IOException: Timeout while reading from the queue-based input
 stream
at org.restlet.engine.io.PipeStream$1.read(PipeStream.java:78)
at java.io.InputStream.read(InputStream.java:171)
at java.io.InputStream.read(InputStream.java:102)
at org.restlet.engine.io.BioUtils.exhaust(BioUtils.java:220)
at
 org.restlet.representation.Representation.exhaust(Representation.java:322)


 Is this a bug, or am I doing something unsupported?

 -Tal




--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2688560

BufferOverflowException v2.1

2010-12-07 Thread webpost
(separated from previous topic)

Guido thanks for the advice. However ...

I have tried again to resolve this problem by using the latest 2.1 snapshot but 
still to no avail. I set the property as early as I can(actually as a launch 
argument using -D{property-name}, that is, long before the Restlet Application 
class has been initialized, but, although the property resorts the value set, 
the BufferOverfloeException remains ??


Previous message ;-

05-Dec-2010 23:57:06 org.restlet.engine.connector.OutboundWay onSelected 
WARNING: Error while writing an HTTP message java.nio.BufferOverflowException 
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:180) at 
org.restlet.engine.io.InputStreamChannel.read(InputStreamChannel.java:173) at 
org.restlet.engine.io.InputStreamChannel.read(InputStreamChannel.java:146) at 
org.restlet.engine.io.ReadableChunkingChannel.read(ReadableChunkingChannel.java:120)
 at 
org.restlet.engine.connector.OutboundWay.fillByteBuffer(OutboundWay.java:207) 
at org.restlet.engine.connector.OutboundWay.onSelected(OutboundWay.java:359) at 
org.restlet.util.SelectionRegistration.onSelected(SelectionRegistration.java:241)
 at org.restlet.engine.connector.Connection.onSelected(Connection.java:519) at 
org.restlet.util.SelectionRegistration.onSelected(SelectionRegistration.java:241)
 at 
org.restlet.engine.connector.ConnectionController.onSelected(ConnectionController.java:183)
 at 
org.restlet.engine.connector.ServerConnectionController.onSelected(ServerConnectionController.java:107)
 at 
org.restlet.engine.connector.ConnectionController.selectKeys(ConnectionController.java:236)
 at 
org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:142)
 at org.restlet.engine.connector.Controller.run(Controller.java:274) at 
org.restlet.engine.connector.ServerConnectionController.run(ServerConnectionController.java:176)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284) at 
java.util.concurrent.FutureTask.run(FutureTask.java:138) at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
 at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) 
at java.lang.Thread.run(Thread.java:810) 05-Dec-2010 23:57:06 
org.restlet.engine.connector.OutboundWay onSelected INFO: Error while writing 
an HTTP message java.nio.BufferOverflowException at 
java.nio.HeapByteBuffer.put(HeapByteBuffer.java:180) at 
org.restlet.engine.io.InputStreamChannel.read(InputStreamChannel.java:173) at 
org.restlet.engine.io.InputStreamChannel.read(InputStreamChannel.java:146) at 
org.restlet.engine.io.ReadableChunkingChannel.read(ReadableChunkingChannel.java:120)
 at 
org.restlet.engine.connector.OutboundWay.fillByteBuffer(OutboundWay.java:207) 
at org.restlet.engine.connector.OutboundWay.onSelected(OutboundWay.java:359) at 
org.restlet.util.SelectionRegistration.onSelected(SelectionRegistration.java:241)
 at org.restlet.engine.connector.Connection.onSelected(Connection.java:519) at 
org.restlet.util.SelectionRegistration.onSelected(SelectionRegistration.java:241)
 at 
org.restlet.engine.connector.ConnectionController.onSelected(ConnectionController.java:183)
 at 
org.restlet.engine.connector.ServerConnectionController.onSelected(ServerConnectionController.java:107)
 at 
org.restlet.engine.connector.ConnectionController.selectKeys(ConnectionController.java:236)
 at 
org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:142)
 at org.restlet.engine.connector.Controller.run(Controller.java:274) at 
org.restlet.engine.connector.ServerConnectionController.run(ServerConnectionController.java:176)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432) at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284) at 
java.util.concurrent.FutureTask.run(FutureTask.java:138) at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
 at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) 
at java.lang.Thread.run(Thread.java:810) 



Fraser

 Hi,
 the current implementation in IOUtils is
 
 public static final int BUFFER_SIZE = getProperty(
 org.restlet.engine.io.bufferSize, 8192);
 
 This is executed only once, afaik at module loading time. A call to
 setProperty should therefore be done before anything of the RESTlet engine
 is loaded, or even on the commandline with a -D parameter to the java
 runtime.
 
 BTW, I tested this setting with a value of -1. Throws a nice exception
 without any test coding.
 
 Guido Schmidt.
 -- 
 View this message in context: 
 http://restlet-discuss.1400322.n2.nabble.com/Serialization-example-NoSuchMethodError-on-Router-attach-tp5782099p5807795.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

--