Hello Ostap,
your issue is certainly linked with the classloaders. You may obtain
better results with the CLAP connector (see [1] for a description of
this scheme):
public void handleGet() {
Response response =
getContext().getClientDispatcher().get(LocalReference.createClapReference(LocalReference.CLAP_CLASS,
path);
getResponse().setEntity(response.getEntity());
}
Could you make some tests with this code? I've tested it as standalone Restlet
(no servlet container), and with Tomcat, and it runs fine.
In addition, as this code uses a new Client connector, you must update your
web.xml file as follow (see [2] for more details about the configuration of the
web.xml), that is to say, add the following lines:
<context-param>
<param-name>org.restlet.clients</param-name>
<param-value>CLAP</param-value>
</context-param>
best regards,
Thierry Boileau
[1]
http://www.restlet.org/documentation/1.1/api/org/restlet/data/LocalReference.html
[2]
http://www.restlet.org/documentation/1.1/ext/com/noelios/restlet/ext/servlet/ServerServlet.html
> Hi All,
>
> I have very puzzling situation.
> My application can be deployed in two modes
> 1. Runs as embedded Jetty
> 2. Runs as war under standalone Jetty
>
> There is a very simple code:
>
> public void handleGet()
> {
> FileRepresentation fr = new FileRepresentation( new File(
> this.getClass().getResource( path ).getFile() ),
>
> MediaType.TEXT_XML,
>
> 1000 );
> getResponse().setEntity( fr );
> getResponse().setStatus( Status.SUCCESS_OK );
> }
>
> That executes just fine under #1 scenario but returns nothing but the
> following working under #2
> [WARNING][org.restlet.Component.Server] A response with an unavailable entity
> was returned. Ignoring the entity for resource
>
> I'm using Restlet 1.1.3.
>
> Any suggestions much appreciated.
>
> Thanks
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1304933
>
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1307112