I have an update to this post. Jerome pointed out the cause of the
NoSuchMethodError problem was likely to be a CLASSPATH issue, i.e. something
was still picking up the 2.0.3 version rather than 2.1. He was correct and once
that was sorted out that particular problem hsa gone away. However ....
If I switch between using the 2.0.3 and 2.1 JARs (with absolutely no code
changes), 2.0.3 will work correctly whereas 2.1 returns the
java.nio.BufferOverflowException shown below.
I have tried this :-
public static void initialise(int Port) throws Exception {
logger.debug("Hi from initialise()");
System.setProperty("org.restlet.engine.io.bufferSize",
"100000");
but this still returns 8192 (the default value) :-
System.out.println(IoUtils.getBufferSize());
What am I doing wrong ?
Thanks
Fraser.
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)
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688062