> Hello Grant,
> 
> the usage of the chunk encoding is perfectly normal and must be supported
> by HTTP servers and clients (except GAE...). I guess this reveals a problem
> with the Netty extension, which should correctly parameter the underlying
> netty http server in such case.

I'm not sure I follow.  The problem isn't that it doesn't send chunked 
encoding.  It's that it thinks all JSON messages are chunked due to the 
JacksonRepresentation not setting the size value correctly.

> Having said that, I propose you to simplify your code, as there is no need
> to specify the netty connector (this is due to a kind of magic that I will
> explain later).
> 
> Component component = new Component();
> component.getServers().add(new Server(Protocol.HTTP, port));

I actually have an if clause in there to check whether to use SSL or not (I 
snipped it out of the msg b/c it didn't seem relevant.  

Would simply specifying HTTP or HTTPS automagically still do the right thing 
and pick the appropriate Netty service?

> 
> Injector injector = Guice.createInjector(new APIModule(apiClass));
> API theAPI = injector.getInstance(apiClass)
> // Then attach it to the local host
> component.getDefaultHost().attach("/api", theAPI);
> // Now, let's start the component!
> component.start();
> 
> At this time, you are only required to add to the classpath the jar of the
> netty extension (org.restlet.ext.netty.jar), and the jar(s) of the
> libraries it depends on.
> At runtime, the engine detects the presence of an HTTP server connector,
> instantiates it, and voila! This magic is based on a simple mechanism
> integrated in the JDK, made public since jdk 6 and called "ServiceLoader".
> 
> As a matter of test, I suggest you to remove the workaround (which is
> useless) and just replace the netty connector by the jetty one : you are
> only required to update your classpath.
> 
> I make some tests also and keep you informed.
> 
> Best regards,
> Thierry Boileau
> 
> My attempted patch at this, which appears to work at first blush, is at
> > https://github.com/lucidimagination/restlet-framework-java/tree/2.0.11-patch
> >
> > ------------------------------------------------------
> >
> > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2924788
> >

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

Reply via email to