Hello all,

When I start up my app, and make the first request to it, I'm seeing
this in my console:

--------
Feb 19, 2009 10:37:40 PM com.noelios.restlet.http.StreamServerCall complete
WARNING: Unable to shutdown server socket
java.net.SocketException: Socket is not connected
        at sun.nio.ch.SocketChannelImpl.shutdown(Native Method)
        at 
sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:583)
        at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:360)
        at 
com.noelios.restlet.http.StreamServerCall.complete(StreamServerCall.java:102)
        at 
com.noelios.restlet.http.HttpServerConverter.commit(HttpServerConverter.java:414)
        at 
com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:148)
        at 
com.noelios.restlet.http.StreamServerHelper$ConnectionHandler.run(StreamServerHelper.java:86)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:613)
--------

I've confirmed that this only occurs when using the built-in server
and returning a TemplateRepresentation. When I return a
StringRepresentation the warning does not occur. When I switch to
Jetty the warning does not occur. And again, this only occurs for the
first request. Subsequent requests do not cause a warning to occur.

Here's the Groovy test case I've got it boiled down to:

--------
class HelloNameRestlet extends Restlet
{
    public void handle(Request request, Response response)
    {
        def data = ["name":"world"]
        response.entity = new
TemplateRepresentation('hello_name.txt.fm', new Configuration(), data,
MediaType.TEXT_PLAIN)
    }
}

new Server(Protocol.HTTP, 3000, new HelloNameRestlet()).start()
--------

Not sure if it matters, but I'm running my tests on an Intel Mac
running OS X 10.5.6 and all updates. I've duplicated this issue with
Java 1.5/32 and 1.6/64, and with Groovy 1.5.6 and 1.6.0.

I'm thinking this might be pointing to a minor bug somewhere, but I
couldn't begin to pinpoint where. I'm hoping someone else can!

Thanks,
Avi

--
Avi Flax » Lead Technologist » Partner » Arc90 » http://arc90.com

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

Reply via email to