Hi guys,

The log trace that you get is not an error, it is an information message
(Level.INFO). It just indicates you that the server will stream its reponse
(content length not known in advance). Therefore, the client must fully
consume it in order to be sure that no content is left on the wire and
properly release the network socket. 

There are also Representation#release() methods that you can use to discard
the remaining content.

If you use a String on the server side, you cache everything in memory,
potentially consuming a lof of resources, but you can then automatically
calculate the content length, indirectly removing the message on the client
side.

To get rid of the log message in production for example, you can also
configure the logging properties:
http://wiki.restlet.org/docs_1.2/13-restlet/48-restlet/101-restlet.html

I hope this clarifies.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com




-----Message d'origine-----
De : Jose Javier García Zornoza [mailto:[email protected]] 
Envoyé : lundi 11 mai 2009 10:55
À : [email protected]
Objet : Re: release the connection

Hello

I think I've read somewhere that the problem is related with Jetty 
manipulation of dom responses.


I've solved the problem changing the result representations:


@Get
public Representation represent(Variant variant) throws ResourceException {
Representation resultRepresentation = null;
try {
List<Curso> listaCursos = dataService.findCursoEntities();
Aula aula = new Aula();
aula.setCursoCollection(listaCursos);
//resultRepresentation =
// new JaxbRepresentation(cursosOutputMediaType, aula);
resultRepresentation = new StringRepresentation(
new JaxbRepresentation(cursosOutputMediaType, aula).getText());
} catch (Exception ex) {
logger.log(Level.SEVERE, ex.toString(), ex);
throw new ResourceException(Status.SERVER_ERROR_INTERNAL, ex);
}
return resultRepresentation;
}


Sending 'JaxbRepresentation' gives me your error, sending 
StringRepresentation solves the problem.


jp escribio':

> hi,
>
> I can see that I got the following message when using Client:
>
> INFO: The length of the message body is unknown. The entity must be
handled carefully and consumed entirely in order to surely release the
connection.
>
>
> how do I assure that the connection is released?
>
> ------------------------------------------------------
>
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=21104
54
>
>

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

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

Reply via email to