Re: Maximum number of concurrent connections

2010-08-23 Thread Nicolas Rinaudo
Hello Thierry,

Thanks for your reply.

Just to make sure I understand properly though, this only applies to the 
internal connector, not others such as the java.net or Apache httpclient ?
I unfortunately can't use the internal connector for our project: we require an 
HTTPS connection which, according to the documentation, isn't supported by the 
internal connector.

It's not a big deal if the feature isn't supported across all connectors, it'd 
just be nice to know for sure so that I can at least mark our internal ticket 
as impossible for the moment and move on to other things :)

Cheers,
Nicolas

On 20 Aug 2010, at 17:42, Thierry Boileau wrote:

 Hello Nicolas,
 
 I'm sorry for my late reply.
 The internal connector allows to set a maxTotalConnections parameter 
 (described in the javadocs of the BaseHelper class, which is  published here: 
 [1]). I've also updated the page dedicated to the connectors [2]. 
 
 
 Note that this apply to both client and server internal connectors. 
 
 Best regards,
 Thierry boileau
 
 [1] 
 http://www.restlet.org/documentation/2.0/jse/engine/org/restlet/engine/http/connector/BaseHelper.html
 [2] http://wiki.restlet.org/docs_2.0/13-restlet/37-restlet.html
 
 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2649294

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


Re: Problems with hanging client calls

2010-08-23 Thread Rickard Öberg
On 2010-08-20 13.31, Freya Impens wrote:
 We had the same issue when upgrading to restlet 2.0.0.
 Some links about the (I think) same issue:

 http://restlet.tigris.org/issues/show_bug.cgi?id=1053  
 andhttp://comments.gmane.org/gmane.comp.java.restlet/12273

 It all boils down to calling the exhaust() method on the response
 representation (in a finally-block), which solves the problem. For some
 reason calling the release() method is not enough, and this 'exhaust'
 solves the problem. We asked a similar question on the list some days ago.

We tried adding exhaust calls, but still see hangs. Btw, it should be 
enough to either fully read using BioUtils.copy *or* exhaust(), right? 
Also, only on response, not request, correct?

Are there any docs on how to switch to httpclient? I checked the 
current docs, and JavaDocs, but couldn't find any instructions on how to 
actually use it.

thanks, Rickard

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


restlets : communicating in SSL with tomcat

2010-08-23 Thread Xavier M.
Hello,
We use Tomcat with SSL configuration to host our restlet application. Up to
now we don't succeed accessing restlets in ssl mode ; Do we need to add ssl
parameters in restlets too, or is the tomcat configuration sufficient?
regards
Xavier

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

stream closed errors

2010-08-23 Thread Freya Impens
Hi all;

we have some errors since upgrading from restlet svn6565 to 2.0.0.
We managed to fix most of them (by making sure we 'exhaust' 
representations if not fully read, see the question Marc asked previous 
week).
But  there is one remaining issue.

Once in a while (cannot predict when), we get IO exceptions that prevent 
a resource from getting loaded. The stacktrace is this one:

java.io.IOException: Closed
 at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:138)
 at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:86)
 at org.restlet.engine.io.BioUtils.copy(BioUtils.java:74)
 at 
org.kauriproject.runtime.module.restservice.ModuleResourceRepresentation.write(ModuleResourceRepresentation.java:27)
 at 
org.restlet.engine.http.ServerCall.writeResponseBody(ServerCall.java:513)
 at 
org.restlet.engine.http.ServerCall.sendResponse(ServerCall.java:450)
 at 
org.restlet.ext.jetty.internal.JettyCall.sendResponse(JettyCall.java:327)
 at 
org.restlet.engine.http.adapter.ServerAdapter.commit(ServerAdapter.java:197)
 at 
org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:151)
 at 
org.restlet.ext.jetty.JettyServerHelper$WrappedServer.handle(JettyServerHelper.java:167)

Our representation is a simple extension of a StreamRepresentation:

public class ModuleResourceRepresentation extends StreamRepresentation {
 private ModuleSource.Resource resource;

 public ModuleResourceRepresentation(ModuleSource.Resource resource, 
MediaType mediaType) {
 super(mediaType);
 this.resource = resource;

 }

 public InputStream getStream() throws IOException {
 return resource.getInputStream();
 }

 public void write(OutputStream outputStream) throws IOException {
 BioUtils.copy(getStream(), outputStream);
 }


}

And this representation is handled in get:

ModuleResourceRepresentation entity = new 
ModuleResourceRepresentation(resource, type);
 response.setEntity(entity);
 response.setStatus(Status.SUCCESS_OK);

I cannot find any way this stream is getting closed or released in our 
code. Does anyone have an idea how this comes?

freya

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


Ideal restlet_GWT configuration ? how to retrieve json with the GWT edition of restlet ?

2010-08-23 Thread webpost
^Hello,

I want to access a web service with a GWT client. My idea is to implement a web 
service that could still be used if I change or add a new client.

I see 3 solutions :
1/ GWT RPC
2/ a json web service
3/ GWT edition of restlet

My analysis :
1/ GWT RPC : if I change of client, I would have to re write also server side 
= eliminated
2/ a json web service : possible, restlet on the server side would be perfect, 
but serialization must be done and on the client side I would have to deal with 
overlay types.
3/ GWT edition of restlet : hum, very seducing, BUT the condition is that I 
manage to retrieve json from any other client than GWT. And so far I was not 
able to do this. It should be possible since it is mentionned in two places in 
the documentation :
 - a comment in the restlet wiki : 
http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html
 - a scheme (4th in the page) : 
http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/185-restlet.html

= does anyone knows how to retrieve json from a ServerRessource without having 
to manualy serialize the object ?

Hereby what I managed to obtain (it works but the serialization is done by 
me...)

public class OperationServerRessource extends ServerResource implements 
OperationRessource {

private Operation ope;

@Override
protected void doInit() {
super.doInit();
this.ope = new Operation(); // the object to send
}


@Get
public Object retrieve() {
return ope;
}

@Get(json) 
// is retrieved when on the client side with this request : 
// (new 
ClientResource(/restlet/testGwtOperationRessource)).get(MediaType.APPLICATION_JSON)
// but I wish I would not have to make the serialization myself...
public String retrieveJson() {
String st = {\key2\:\value2\, \key1\:\value1\};
return st;
}

}

thank's 

Ben

ps : a forum instead of a mailing list could be a good way to facilitate the 
community get bigger (in a forum you can ad nice links, blocs of code, mail 
triggered when there is a new reply on the post you follow etc ...) That's just 
a suggestion, there may be some good reasons for keeping a mailing list...

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


RE: GWT demo project with R2.0.0

2010-08-23 Thread Benibur
well, I made the test, with both the snapshot and the 2.0 stable release.
I always have the same behaviour as with the project dowloaded and run without 
any modification...
I think this is a problem with the tutorial, but i should not be the only one 
with this pb (the warnings are the same on my different computers...).

any idea ?

regards,

Ben

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