I have a very similar issue with the simple attached code: It happens with a POST in this case on the v2.0 RC2 (testing) codebase...I thought this info might be useful for reproducing....
1) Here I have a simple Restlet Server application which returns some hardcoded
xml
2) I write a little restlet app that will be a pass-through proxy - the intent
was to dump the request and response xml to the console and forward the request
to the Simple-Server. It was really just playing with stuff.
3) I have a method to dump the request xml from the proxy to the console
Util.printRepresentation("Request:", entity);
Which is pretty much just:
representation.write(System.out); //dump to console
When I dump to console before "forwarding" then I get the hang...otherwise it
works ok!
@Post("xml")
public Representation acceptItem(Representation entity) {
try {
ProxyApplication proxyApplication =
(ProxyApplication)getApplication();
//Util.printRepresentation("Request:", entity);
ClientResource itemsResource = new
ClientResource(proxyApplication.getServerUri());
Representation r = itemsResource.post(new
DomRepresentation(entity));
if (itemsResource.getStatus().isSuccess()) {
//itemResource = new ClientResource(r.getLocationRef());
}
//Util.printRepresentation("Response:", r);
return r;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
Steps are:
0) Uncommenent line in DefaultResource Util.printRepresentation("Request:",
entity);
1) Start SimpleServerMain
2) Start ProxyMain
3) run command:
curl -d "<arbitraryXml>blah</arbitraryXml>" http://localhost:8181/anything
Note, if I don't dump the resource (skip step 0), I get the response as
expected....
In failing case it hangs in same place i.e.
BaseClientHelper.handle() in latch.await()
Am I doing something stupid? Any ideas? Same issue as this thread talks about?
Should I raise a ticket?
thanks
Conor
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2531100
DefaultResource.java
Description: Binary data
ProxyApplication.java
Description: Binary data
ProxyMain.java
Description: Binary data
SimpleServerMain.java
Description: Binary data
Util.java
Description: Binary data

