Re: SSL intermediate cert issue

2016-03-19 Thread Thierry Boileau
Hello Christine,

nice to hear such good news :)

Best regards,
Thierry Boileau

Le mar. 15 mars 2016 à 21:24, Christine Karman <christ...@christine.nl> a
écrit :

> On 04-03-16 15:29, Thierry Boileau wrote:
>
> Hello Christine,
>
> I wonder if all the intermediate certificates have been registered in the
> keystore with the same alias entry.
> Could you have a look at this post?
>
> http://stackoverflow.com/questions/9299133/why-doesnt-java-send-the-client-certificate-during-ssl-handshake/9300727#9300727
>
>
> Thierry,
> I made a mistake in building the keystore, sorry for the fuss. It works
> now.
>
> I'm very happy with Restlet :-)
>
>
> dagdag
>
> Christine
>
>
>
> Best regards,
> Thierry Boileau
>
> Le mer. 2 mars 2016 à 22:45, Christine Karman <christ...@christine.nl> a
> écrit :
>
>> I want to switch from using a self-signed certificate in Restlet, which
>> worked well, to a startcom certificate. The reason I want to change it
>> is that I want to give third parties access to the server without having
>> to give them my self signed cert.
>>
>> Now I see an issue with Restlet apparently not sending the certificate
>> chain, which my android app doesn't like. When I type
>>
>> openssl s_client -showcerts -connect pengo.christine.nl:9005
>>
>> in a shell, I get this error:
>>
>> CONNECTED(0003)
>> depth=0 CN = pengo.christine.nl
>> verify error:num=20:unable to get local issuer certificate
>> verify return:1
>> depth=0 CN = pengo.christine.nl
>> verify error:num=21:unable to verify the first certificate
>> verify return:1
>>
>> When I type
>> openssl s_client -showcerts -connect pengo.christine.nl:9005 -CAfile
>> ./chain.crt
>>
>> with chain.crt containing the root cert and intermediate cert, I get
>>
>> CONNECTED(0003)
>> depth=2 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate
>> Signing, CN = StartCom Certification Authority
>> verify return:1
>> depth=1 C = IL, O = StartCom Ltd., OU = StartCom Certification
>> Authority, CN = StartCom Class 1 DV Server CA
>> verify return:1
>> depth=0 CN = pengo.christine.nl
>> verify return:1
>>
>> My restlet configuration contains
>>
>>  params.add("sslContextFactory",
>> "org.restlet.engine.ssl.DefaultSslContextFactory");
>>  params.add("keystorePath",
>> "/home/christine/motogymkhana/pengo_ssl.jks");
>>  params.add("keystorePassword", ServerConstants.keyStorePw);
>>  params.add("keystoreType", "JKS");
>>  params.add("keyAlias", ServerConstants.keyAlias);
>>  params.add("keyPassword", ServerConstants.keyPw);
>>
>> The keystore does contain the same certificates as the chain.crt file.
>>
>> How do I make Restlet send the chain with the certificate?
>>
>> dagdag
>> Christine
>>
>>
>> --
>> dagdag is just a two character rotation of byebye
>>
>> --
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447=3164075
>>
>
>
> --
> dagdag is just a two character rotation of byebye
>
>

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

Re: SSL intermediate cert issue

2016-03-04 Thread Thierry Boileau
Hello Christine,

I wonder if all the intermediate certificates have been registered in the
keystore with the same alias entry.
Could you have a look at this post?
http://stackoverflow.com/questions/9299133/why-doesnt-java-send-the-client-certificate-during-ssl-handshake/9300727#9300727

Best regards,
Thierry Boileau

Le mer. 2 mars 2016 à 22:45, Christine Karman <christ...@christine.nl> a
écrit :

> I want to switch from using a self-signed certificate in Restlet, which
> worked well, to a startcom certificate. The reason I want to change it
> is that I want to give third parties access to the server without having
> to give them my self signed cert.
>
> Now I see an issue with Restlet apparently not sending the certificate
> chain, which my android app doesn't like. When I type
>
> openssl s_client -showcerts -connect pengo.christine.nl:9005
>
> in a shell, I get this error:
>
> CONNECTED(0003)
> depth=0 CN = pengo.christine.nl
> verify error:num=20:unable to get local issuer certificate
> verify return:1
> depth=0 CN = pengo.christine.nl
> verify error:num=21:unable to verify the first certificate
> verify return:1
>
> When I type
> openssl s_client -showcerts -connect pengo.christine.nl:9005 -CAfile
> ./chain.crt
>
> with chain.crt containing the root cert and intermediate cert, I get
>
> CONNECTED(0003)
> depth=2 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate
> Signing, CN = StartCom Certification Authority
> verify return:1
> depth=1 C = IL, O = StartCom Ltd., OU = StartCom Certification
> Authority, CN = StartCom Class 1 DV Server CA
> verify return:1
> depth=0 CN = pengo.christine.nl
> verify return:1
>
> My restlet configuration contains
>
>  params.add("sslContextFactory",
> "org.restlet.engine.ssl.DefaultSslContextFactory");
>  params.add("keystorePath",
> "/home/christine/motogymkhana/pengo_ssl.jks");
>  params.add("keystorePassword", ServerConstants.keyStorePw);
>  params.add("keystoreType", "JKS");
>  params.add("keyAlias", ServerConstants.keyAlias);
>  params.add("keyPassword", ServerConstants.keyPw);
>
> The keystore does contain the same certificates as the chain.crt file.
>
> How do I make Restlet send the chain with the certificate?
>
> dagdag
> Christine
>
>
> --
> dagdag is just a two character rotation of byebye
>
> --
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447=3164075
>

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

RE: Re: GWT with Restlet JSE examples

2015-04-30 Thread Thierry Boileau
Hello Guillaume,

sample code has been recovered, cf 
http://restlet.com/technical-resources/restlet-framework/guide/2.3/editions/gwt/examples

Best regards,
Thierry Boileau

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


Re: Unable to find converter for java.util.UUID

2015-03-16 Thread Thierry Boileau
Hello,

could you tell us what kind of converters are you using on server side, and
those on client side?
If this question is not clear, could you send us the list of extensions
used on both side (all jars like org.restlet.ext.*).

Best regards,
Thierry Boileau

2015-03-16 12:30 GMT+01:00 Chirayu Desai chir...@purpledocs.com:

 I am working on a client server application. I was using Restlet 2.0.3. Due
 to a heavy load task my client was getting timed-out. I searched on the
 forum and found that switching over to Restlet 2.2 would help. So I did
 that. I upgraded my Restlet to 2.2.1. But now my code has stopped working
 at
 precisely this method.

 *public synchronized UUID generateUniqueSessionId(String userAtDomain)
 {
 UUID newSessionId = UUID.randomUUID();
 SessionAttributes sessionAttributes = new SessionAttributes();
 sessionAttributes.setAlive(true);
 sessionAttributes.setFQUserName(userAtDomain);
 loggedInUsers.put(newSessionId, sessionAttributes);
 return newSessionId;
 }*
 So I am returning the UUID at last. This code is on the server and invoked
 during login. Following is the error that I am getting from the logs.

 *16 Mar 2015 11:23:18 WARN - Unable to find a converter for this object :
 f3d2edda-443c-454d-856a-fb4e7ed9c535*

 And this object referred in the log belongs to java.util.UUID

 The code on the client side which invokes the server looks like this.

 *public UUID authenticateUser(String username, String passwd) {

 try {
 String url =
 RESTLetWebSvcsFactory.getFactoryInstance().getServer_URL() + login/ +
 username + / + passwd;

 Context context = new Context();

 Client client = new Client(context, Protocol.HTTP);
 ClientHelper helper = new ClientHelper(client);
 helper.getHelpedParameters().set(socketConnectTimeoutMs,
 6);

 ClientResource cr = new ClientResource(url);
 LoginLogoutResource resource =
 cr.wrap(LoginLogoutResource.class);
 return resource.loginUser();
 } catch (ResourceException re) {
 if (re.getStatus().isConnectorError()) {
 try {
 RESTLetWebSvcsFactory.enableFallBackServer();
 String url =
 RESTLetWebSvcsFactory.getFactoryInstance().getServer_URL() + login/ +
 username + / + passwd;
 ClientResource cr = new ClientResource(url);
 LoginLogoutResource resource =
 cr.wrap(LoginLogoutResource.class);
 return resource.loginUser();
 } catch (ResourceException re1) {
 int statusCode = new
 RESTLetErrorHandler().handleServerError(re);
 if (statusCode != -1) {
 throw new UserCRUDException(statusCode);
 }
 }
 } else {
 throw new UserCRUDException(new
 RESTLetErrorHandler().handleServerError(re));
 }
 }
 return null;
 }*
 Note: USERCRUDException is my own exception and not one of JAVA

 Please help me resolve this problem which probably prevents returning the
 UUID from the server and thus my application isn't moving ahead.

 Thanks in advance



 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/Unable-to-find-converter-for-java-util-UUID-tp7579358.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

Re: Restelt Client Internal Connector Error (1002)

2015-03-16 Thread Thierry Boileau
Hello,

some things are not clear to me:
 - are you sure the server answers quickly, or do know that the server
takes time?
 - when you set up time out on client side, does it have any effect?

Best regards,
Thierry Boileau

2015-03-16 6:11 GMT+01:00 Chirayu Desai chir...@purpledocs.com:

 Hi,
 Followin are my code snippets:

 At Client RESTLet :

 @Override
 public Task getTask(int taskId) {

 logger.debug( RESTLetTaskDAO.getTask taskid = {} , taskId);
 Task task = null;
 try {
 final Context context = new Context();
 context.getParameters().set(socketTimeout, 12);

 String url = RESTLetWebSvcsFactory.getFactoryInstance().getServer_URL() +
 task/
 +sessionId;
   ClientResource cr = new ClientResource(context,url);
 TaskResource resource = cr.wrap(TaskResource.class);
 *task = resource.getTask(taskId);*
 }
 catch (ResourceException re) {
 int statusCode = new RESTLetErrorHandler().handleServerError(re);
 if (statusCode != -1){
 throw new CRUDException(statusCode);
 }
 }
 return task;
 }


 At Server Restlet :

 @Get
 public Task getTask(int taskId) throws CRUDException,
 SessionTerminatedException {

 String userSessionId = (String)
 this.getRequest().getAttributes().get(sessionid);
 TaskDAO taskDAO = DAOFactory.getDefaultFactory().getTaskDAO();
 Task task = taskDAO.getTask(taskId);
 if (task != null) {
 logger.trace(TaskResourceImpl.getTask sessionid = {}, task fetched =
 {},task.toFormattedString());
 }
 else {
 logger.error(TaskResourceImpl.getTask No task matching criteria found -
 task is null);
 }
 return task;
 }


 The error log At server :

 16 Mar 2015 10:27:00  INFO - 2015-03-16 10:27:00 127.0.0.1 - 127.0.0.1
 8080 GET
 /purpledocsstar_svr/tasks/0/0/null/0/all/null/null/c300647c-7fcb-45bf-a45a-9d7cf87b4598
 - 200 - 0 60026 http://localhost:8080 Restlet-Framework/2.0.13 -
 16 Mar 2015 10:27:09 DEBUG - ErrorStatusService.getStatus code Throwable
 throwable,UniformResource resource
 16 Mar 2015 10:27:09 DEBUG - ErrorStatusService.getStatus Throwable
 throwable, Request request, Response response
 16 Mar 2015 10:27:09  INFO - ErrorStatusService.getStatus - throwable NOT
 instanceof DBCRUDException
 16 Mar 2015 10:27:09  INFO - ErrorStatusService.getStatus - throwable NOT
 instanceof DBCRUDException
 16 Mar 2015 10:27:09  WARN - Exception or error caught in resource
 java.lang.IllegalArgumentException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.restlet.resource.ServerResource.doHandle(ServerResource.java:449)
 at org.restlet.resource.ServerResource.get(ServerResource.java:648)
 at org.restlet.resource.ServerResource.doHandle(ServerResource.java:530)
 at
 org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:590)
 at
 org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:302)
 at org.restlet.resource.ServerResource.handle(ServerResource.java:849)
 at org.restlet.resource.Finder.handle(Finder.java:513)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.routing.Router.doHandle(Router.java:500)
 at org.restlet.routing.Router.handle(Router.java:740)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at
 org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:154)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.engine.ChainHelper.handle(ChainHelper.java:114)
 at
 org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:75)
 at org.restlet.Application.handle(Application.java:391)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.routing.Router.doHandle(Router.java:500)
 at org.restlet.routing.Router.handle(Router.java:740)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.routing.Router.doHandle(Router.java:500)
 at org.restlet.routing.Router.handle(Router.java:740)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at org.restlet.engine.ChainHelper.handle(ChainHelper.java:114)
 at org.restlet.Component.handle(Component.java:391)
 at org.restlet.Server.handle(Server.java:491)
 at org.restlet.engine.ServerHelper.handle(ServerHelper.java:74

Re: Unable to find converter for java.util.UUID

2015-03-16 Thread Thierry Boileau
Hi,

a workaround is to return a String instance:

public UUID authenticateUser(String username, String passwd) {

[...]
return resource.loginUser().toString();
[...]
}

Best regards,
Thierry Boileau

2015-03-16 15:12 GMT+01:00 Thierry Boileau tboil...@restlet.com:

 Hello,

 could you tell us what kind of converters are you using on server side,
 and those on client side?
 If this question is not clear, could you send us the list of extensions
 used on both side (all jars like org.restlet.ext.*).

 Best regards,
 Thierry Boileau

 2015-03-16 12:30 GMT+01:00 Chirayu Desai chir...@purpledocs.com:

 I am working on a client server application. I was using Restlet 2.0.3.
 Due
 to a heavy load task my client was getting timed-out. I searched on the
 forum and found that switching over to Restlet 2.2 would help. So I did
 that. I upgraded my Restlet to 2.2.1. But now my code has stopped working
 at
 precisely this method.

 *public synchronized UUID generateUniqueSessionId(String userAtDomain)
 {
 UUID newSessionId = UUID.randomUUID();
 SessionAttributes sessionAttributes = new SessionAttributes();
 sessionAttributes.setAlive(true);
 sessionAttributes.setFQUserName(userAtDomain);
 loggedInUsers.put(newSessionId, sessionAttributes);
 return newSessionId;
 }*
 So I am returning the UUID at last. This code is on the server and invoked
 during login. Following is the error that I am getting from the logs.

 *16 Mar 2015 11:23:18 WARN - Unable to find a converter for this object :
 f3d2edda-443c-454d-856a-fb4e7ed9c535*

 And this object referred in the log belongs to java.util.UUID

 The code on the client side which invokes the server looks like this.

 *public UUID authenticateUser(String username, String passwd) {

 try {
 String url =
 RESTLetWebSvcsFactory.getFactoryInstance().getServer_URL() + login/ +
 username + / + passwd;

 Context context = new Context();

 Client client = new Client(context, Protocol.HTTP);
 ClientHelper helper = new ClientHelper(client);
 helper.getHelpedParameters().set(socketConnectTimeoutMs,
 6);

 ClientResource cr = new ClientResource(url);
 LoginLogoutResource resource =
 cr.wrap(LoginLogoutResource.class);
 return resource.loginUser();
 } catch (ResourceException re) {
 if (re.getStatus().isConnectorError()) {
 try {
 RESTLetWebSvcsFactory.enableFallBackServer();
 String url =
 RESTLetWebSvcsFactory.getFactoryInstance().getServer_URL() + login/ +
 username + / + passwd;
 ClientResource cr = new ClientResource(url);
 LoginLogoutResource resource =
 cr.wrap(LoginLogoutResource.class);
 return resource.loginUser();
 } catch (ResourceException re1) {
 int statusCode = new
 RESTLetErrorHandler().handleServerError(re);
 if (statusCode != -1) {
 throw new UserCRUDException(statusCode);
 }
 }
 } else {
 throw new UserCRUDException(new
 RESTLetErrorHandler().handleServerError(re));
 }
 }
 return null;
 }*
 Note: USERCRUDException is my own exception and not one of JAVA

 Please help me resolve this problem which probably prevents returning the
 UUID from the server and thus my application isn't moving ahead.

 Thanks in advance



 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/Unable-to-find-converter-for-java-util-UUID-tp7579358.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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




 --
 *Thierry Boileau, Mr B*
 +1 (408) 387-3184 • tboil...@restlet.com

 http://restlet.com/
 6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

Re: Unable to find converter for java.util.UUID

2015-03-16 Thread Thierry Boileau
Hi,

I guess I understand what happens.
Initially, the conversions between the UUID instance and a flow of bytes
and vice versa was taken into account by the default converter shipped with
the core Restlet Framework jar (org.restlet.jar).
More precisely, these conversions leveraged the bean serialization provided
by the JDK (ObjectInputStream and ObjectOutputStream objects). As reported
here: https://github.com/restlet/restlet-framework-java/issues/778, such
classes are to be used very cautiously, and have been deactivated by
default since RF 2.1.4.

This explains why your code works in RF 2.0.3, and not in RF 2.2. You can
still activate it by setting the sytem property
org.restlet.representation.ObjectRepresentation.VARIANT_OBJECT_BINARY_SUPPORTED
to true.

At this point:
 - either you rely on the JDK serialization (but take really care because
you expose your API to security issues), which will allow you to
serialize/deserialize beans on both sides.
 - or you don't need serialize any other beans, so, you can keep the
String return parameter
 - or you still want to exchange beans,then you must rely on other
converter (for example: Jackson).

Having said that, I've made a test using UUID, and it works with the
Jackson extension.

Best regards,
Thierry Boileau






2015-03-16 16:08 GMT+01:00 Chirayu Desai chir...@purpledocs.com:

 Hi. Thanks for the prompt reply.

 I am using the following:

 org.restlet.jar
 And for the ext. I am using the following
 1.fileupload
 2.slf4j
 3.xml
 4.servlet

 This on the server side..

 On the client side I have org.restlet.jar only..

 
 I will also try your work around that you sent regarding returning the
 String instead of UUID and get back to you with the results. However it
 would be great if the problem solves at an architecture level and not
 specific to this class only.

 On Mon, Mar 16, 2015 at 7:51 PM, Thierry Boileau-4 [via Restlet Discuss] 
 [hidden
 email] http:///user/SendEmail.jtp?type=nodenode=7579363i=0 wrote:

 Hi,

 a workaround is to return a String instance:

 public UUID authenticateUser(String username, String passwd) {

 [...]
 return resource.loginUser().toString();
 [...]
 }

 Best regards,
 Thierry Boileau

 2015-03-16 15:12 GMT+01:00 Thierry Boileau [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=7579360i=0:

 Hello,

 could you tell us what kind of converters are you using on server side,
 and those on client side?
 If this question is not clear, could you send us the list of extensions
 used on both side (all jars like org.restlet.ext.*).

 Best regards,
 Thierry Boileau

 2015-03-16 12:30 GMT+01:00 Chirayu Desai [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=7579360i=1:

 I am working on a client server application. I was using Restlet 2.0.3.
 Due
 to a heavy load task my client was getting timed-out. I searched on the
 forum and found that switching over to Restlet 2.2 would help. So I did
 that. I upgraded my Restlet to 2.2.1. But now my code has stopped
 working at
 precisely this method.

 *public synchronized UUID generateUniqueSessionId(String userAtDomain)
 {
 UUID newSessionId = UUID.randomUUID();
 SessionAttributes sessionAttributes = new SessionAttributes();
 sessionAttributes.setAlive(true);
 sessionAttributes.setFQUserName(userAtDomain);
 loggedInUsers.put(newSessionId, sessionAttributes);
 return newSessionId;
 }*
 So I am returning the UUID at last. This code is on the server and
 invoked
 during login. Following is the error that I am getting from the logs.

 *16 Mar 2015 11:23:18 WARN - Unable to find a converter for this object
 :
 f3d2edda-443c-454d-856a-fb4e7ed9c535*

 And this object referred in the log belongs to java.util.UUID

 The code on the client side which invokes the server looks like this.

 *public UUID authenticateUser(String username, String passwd) {

 try {
 String url =
 RESTLetWebSvcsFactory.getFactoryInstance().getServer_URL() + login/ +
 username + / + passwd;

 Context context = new Context();

 Client client = new Client(context, Protocol.HTTP);
 ClientHelper helper = new ClientHelper(client);
 helper.getHelpedParameters().set(socketConnectTimeoutMs,
 6);

 ClientResource cr = new ClientResource(url);
 LoginLogoutResource resource =
 cr.wrap(LoginLogoutResource.class);
 return resource.loginUser();
 } catch (ResourceException re) {
 if (re.getStatus().isConnectorError()) {
 try {
 RESTLetWebSvcsFactory.enableFallBackServer();
 String url =
 RESTLetWebSvcsFactory.getFactoryInstance().getServer_URL() + login/ +
 username + / + passwd;
 ClientResource cr = new ClientResource(url);
 LoginLogoutResource resource =
 cr.wrap(LoginLogoutResource.class);
 return

Re: Restelt Client Internal Connector Error (1002)

2015-03-12 Thread Thierry Boileau
Hello,

but using the org.restlet.ext.http connector i am unable to send objects
as method arguments from client to server,
Could you give a little bit more details on how you send objects, and
perhaps better could you show some sample code?

and am getting illegal argument and null pointer exceptions.
are you issuing such exceptions on client side or server side?
Do you have any stack trace?

Best regards,
Thierry Boileau




and am getting illegal argument and null pointer exceptions.

2015-03-12 9:28 GMT+01:00 Chirayu Desai chir...@purpledocs.com:

 I am able to reslove the time out issue but using the org.restlet.ext.http
 connector i am unable to send objects as method arguments from client to
 server,and am getting illegal argument and null pointer exceptions.

 On Wed, Mar 11, 2015 at 7:18 PM, Fabian Mandelbaum [via Restlet Discuss] 
 [hidden
 email] http:///user/SendEmail.jtp?type=nodenode=7579352i=0 wrote:

 Another possible solution with such requests, which may take LONG to
 process, is to have the server return HTTP 202 (Accepted) as soon as it's
 ready to process the request, and the client knows its request will be
 processed later.

 Of course, you may also need another server resource to query the status
 of such to be processed later requests.

 HTH


 On Tue, Mar 10, 2015 at 8:52 PM, Jerome Louvel [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=7579351i=0 wrote:

 If you need to stick with version 2.1, I recommend using the Apache HTTP
 Client extension (see socketTimeout parameter):

 http://restlet.com/technical-resources/restlet-framework/javadocs/2.1/jee/ext/org/restlet/ext/httpclient/HttpClientHelper.html

 or the Net HTTP Client extension (see readTimeout parameter):

 http://restlet.com/technical-resources/restlet-framework/javadocs/2.1/jee/ext/org/restlet/ext/net/HttpClientHelper.html

 Jerome


 On Tue, Mar 10, 2015 at 2:13 PM, Chirayu Desai [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=7579351i=1 wrote:

 No the request processing at server may or maynot take more than 1
 minute, which means that the server may not necessaryly respond before
 timeout.

 On Wed, Mar 11, 2015 at 2:37 AM, Jerome Louvel-3 [via Restlet Discuss]
 [hidden email] http:///user/SendEmail.jtp?type=nodenode=7579349i=0
  wrote:

 Hello Chirayu,

 Is your server supposed to answer before the timeout observed?
 Also, are you be able to upgrade to version 2.3.1 (stable)?

 Best regards,
 Jerome


 On Tue, Mar 10, 2015 at 1:04 PM, Chirayu Desai [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=7579348i=0 wrote:

 I am using a restlet 2.1 client sever based architecture, my client
 times out
 within 1 minute after sending the request. and I get the following
 exception
 :
 Internal Connector Error (1002) - The calling thread timed out while
 waiting
 for a response to unblock it.
 at
 org.restlet.resource.ClientResource$1.invoke(ClientResource.java:1663)
 at com.sun.proxy.$Proxy17.getTaskList(Unknown Source)

 My code is as below :

 import org.restlet.resource.ClientResource;

 *ClientResource cr = new ClientResource(uri);
 MyResource resource= cr.wrap(MyResource .class);
 updateStatus =
 resource.updateData(Parameter);*

 how should I configure my client resource to avoid timeout ?



 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/Restelt-Client-Internal-Connector-Error-1002-tp7579347.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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




 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://restlet-discuss.1400322.n2.nabble.com/Restelt-Client-Internal-Connector-Error-1002-tp7579347p7579348.html
  To unsubscribe from Restelt Client Internal Connector Error (1002), click
 here.
 NAML
 http://restlet-discuss.1400322.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --
 -Regards,
 -Chirayu Desai

 --
 View this message in context: Re: Restelt Client Internal Connector
 Error (1002)
 http://restlet-discuss.1400322.n2.nabble.com/Restelt-Client-Internal-Connector-Error-1002-tp7579347p7579349.html

 Sent from the Restlet Discuss mailing list archive
 http://restlet-discuss.1400322.n2.nabble.com/ at Nabble.com.





 --
 Fabián Mandelbaum
 IS Engineer


 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://restlet

Re: Restlet cannot process query parameter on ROOT path

2015-02-08 Thread Thierry Boileau
Hello,

I've tried your code and the filter is triggered and has access to the
query parameter in every cases.
Having said that, I notice that the call to http://localhost:8080/?test=test
returns a 404 status because there is no url template that matches the /
url.
When defining this template /{id} the {id} variable cannot be empty.

Best regards,
Thierry Boileau

2015-02-08 7:49 GMT+01:00 Xybrek xyb...@gmail.com:

 I have this code:

 @Override
 public Restlet createInboundRoot() {

  Router router = new Router(getContext());

  Redirector forward = new Redirector(getContext(), SOME_URL,
  Redirector.MODE_CLIENT_FOUND);

  router.attach(/ + {id}, forward);
  router.attach(/rest/, RootServerResource.class);

  MyFilter myFilter = new MyFilter(getContext());
  myFilter.setNext(router);

  return myFilter;
 }

 The problem with this code is that Restlet cannot seem to process query
 parameter on ROOT path:

 http://localhost:8080/?test=test

 Filter does not trigger.

 However, when through the /rest/ part

 http://localhost:8080/rest/?test=test

 Filter gets triggered.

 What could be the problem with this code?

 --

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




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

Re: Redirect whole browser traffic to restlet proxy

2015-02-04 Thread Thierry Boileau
thanks!

have a good day,
Thierry Boileau

2015-01-03 20:41 GMT+01:00 Xybrek xyb...@gmail.com:

 On Tuesday, 07 October, 2014 08:12 PM, Jovan Jovanovic wrote:
  Hi everybody,
 
  after a lot of tries to build a proxy server I found it really easy
 using Restlet. Although I have an obvious issue after setting all the
 traffic from Chrome to go through my proxy, I get redirection loop (as also
 the routed URL is trying to go through proxy). Here is the code that I am
 using:
 
public static void main(String[] args) throws Exception {
   Component component = new Component();
   component.getClients().add(Protocol.HTTP);
   component.getServers().add(Protocol.HTTP, 8111);
   Application application = new RestletProxy();
  component.getDefaultHost().attachDefault(application);
   component.start();
   }
   @Override
   public Restlet createInboundRoot() {
 Router router = new Router(getContext());
 String target = http://www.google.com;;
 Redirector redirector = new  Redirector(getContext(), target);
 router.attachDefault(redirector);
 return router;
   }
 
  So I am just trying to redirect every single request to google. Is it
 possible using restlet?
 
  --
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3089543
 

 I just want to share that yes it is possible, I have a running proxy in
 heroku that runs Restlet proxy and redirects all traffic to a given URL

 --

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




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

Re: HTTP/1.1 422 Unprocessable Entity - Error

2015-02-04 Thread Thierry Boileau
]   at
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  [INFO]   at
 
 com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
  [INFO]   at
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  [INFO]   at
 
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
  [INFO]   at
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  [INFO]   at
 
 com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
  [INFO]   at
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  [INFO]   at
 
 com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
  [INFO]   at
 
 com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
  [INFO]   at
 
 com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
  [INFO]   at
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  [INFO]   at
  org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
  [INFO]   at
 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  [INFO]   at
  org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  [INFO]   at
  org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  [INFO]   at
  org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
  [INFO]   at
 
 com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
  [INFO]   at
  org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  [INFO]   at
 
 com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:491)
  [INFO]   at
  org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  [INFO]   at org.mortbay.jetty.Server.handle(Server.java:326)
  [INFO]   at
  org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  [INFO]   at
 
 org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
  [INFO]   at
 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
  [INFO]   at
 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
  [INFO]   at
 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
  [INFO]   at
 
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
  [INFO]   at
 
 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
 
  --
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3094175
 
 
 
  I also have tried downgrading to 2.2.2 and the Error 422 comes back,
  what could the solution for this?
 
  --
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3094177
 

 After quite tries it seems Restlet cannot serialize some parts of the
 POJO, is there way to make Restlet log the specific part that can't be
 serialized?

 --

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




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

RE: Is there any concrete example on how to use Restlet File Upload extension with Google App Engine?

2015-01-16 Thread Thierry Boileau
Hello,
I guess you are refering to this page of the user guide:
http://restlet.com/technical-resources/restlet-framework/guide/2.3/extensions/fileupload

The code is exactly the same for the GAE edition, except that you cannot write 
File directly as is it forbidden by the GAE platform.

You can still have access to the FileItem#getInputStream() method.


Best regards,
Thierry Boileau

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


RE: CRUD Operation for Calling ServerResouce with ClientProxy

2015-01-16 Thread Thierry Boileau
Hello,

I guess I should explain the mapping between Java methods and HTTP request.
Using Restlet Framework, the annotated methods follow these conventions:
 - there is either one or no parameter to a Java method.
 - such parameter is either an instance of the Representation (that wraps the 
flow of bytes coming from the socket) or an instance of a Java bean which is 
the conversion of the entity sent by the client in the incoming request.

In your case, the annotated method is as follow:

@Get
public void readThing(Long id, ResultThingItem callback);

Which can't happen since a GET request has no entity. Same issue for the DELETE 
method.

Here is my first refactoring:
 - GaeThingServerResource is attached as follow
router.attach(/thingitems/{thingitemid}

 - Here is content of the GaeThingServerResource class.
public class GaeThingServerResource extends SelfInjectingServerResource
 implements ThingResource {
 private static final Logger LOG
 = Logger.getLogger(Gae​ThingServerResource.​class.getName());

 /** The identifier of the resource. */
 private Long id;

 @Override
 public ThingItem doInit() {
 id = Long.parseLong(getAttribute(thingitemid));
 // You may check that the resource really exist
// setExisting(true or false);
 }

 @Override
 public ThingItem createThing(ThingItem Thing) {
 store().put(Thing);
 return Thing;
 }

 @Override
 public ThingItem readThing() {
 LOG.info(Read Thing id= + id);
 ThingItem result = store().get(ThingItem.class, id);
 return result;
 }

 @Override
 public ThingItem updateThing(ThingItem Thing) {
 LOG.info(Updating Thing= + Thing.toString());
 store().put(Thing);
 return Thing;
 }

 @Override
 public void deleteThing() {
 LOG.info(Delete Thing id= + id);
 store().delete(ThingItem.class, id);
 }
}

I guess you may have another question about how to create an entity.

Best regards,
Thierry Boileau

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


Re: Is there any concrete example on how to use Restlet File Upload extension with Google App Engine?

2015-01-16 Thread Thierry Boileau
Hello,

I've made some tests, and I think I will change the documentation, as we
can have the same code in classic JVM, or GAE/servlet contexts:
In this sample code, we just send back the content of the fileToUpload
item.

@Post
public Representation accept(Representation entity) throws Exception {
Representation result = null;
if (entity != null) {
if (MediaType.MULTIPART_FORM_DATA.equals(entity.getMediaType(),
true)) {
// 1/ Create a factory for disk-based file items
DiskFileItemFactory factory = new DiskFileItemFactory();
factory.setSizeThreshold(1000240);

// 2/ Create a new file upload handler based on the Restlet
// FileUpload extension that will parse Restlet requests and
// generates FileItems.
RestletFileUpload upload = new RestletFileUpload(factory);

// 3/ Request is parsed by the handler which generates a
// list of FileItems
FileItemIterator fileIterator =
upload.getItemIterator(entity);

// Process only the uploaded item called fileToUpload
// an return back
boolean found = false;
while (fileIterator.hasNext()  !found) {
FileItemStream fi = fileIterator.next();
if (fi.getFieldName().equals(fileToUpload)) {
found = true;
// consume the stream immediately, otherwise the
stream
// will be closed.
StringBuilder sb = new StringBuilder(media type:
);
sb.append(fi.getContentType()).append(\n);
sb.append(file name : );
sb.append(fi.getName()).append(\n);
BufferedReader br = new BufferedReader(
new InputStreamReader(fi.openStream()));
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line);
}
sb.append(\n);
result = new StringRepresentation(sb.toString(),
MediaType.TEXT_PLAIN);
}
}
} else {
// POST request with no entity.
setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
}
}

return result;
}


Having said that, I think I will change the implementation of the
RestletFileUpload#parseRequest method in order to rely on the underlying
servlet, and remove the RestletFileUpload#parseRepresentation  method.

Thanks a lot.

2015-01-16 11:41 GMT+01:00 Xybrek xyb...@gmail.com:

 On Friday, 16 January, 2015 05:51 PM, Thierry Boileau wrote:
  Hello,
  I guess you are refering to this page of the user guide:
 
 http://restlet.com/technical-resources/restlet-framework/guide/2.3/extensions/fileupload
 
  The code is exactly the same for the GAE edition, except that you cannot
 write File directly as is it forbidden by the GAE platform.
 
  You can still have access to the FileItem#getInputStream() method.
 
 
  Best regards,
  Thierry Boileau
 
  --
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3094350
 

 Theierry,

 I am not sure but it seems the sample you gave throws error and we
 cannot use the repackaged apache package with Restlet.

 So I improvised, I manage to upload large files with Restlet and GAE
 with this code:

  @Override
  public void upload(Representation entity) throws Exception {
  if (entity != null) {
  if
 (MediaType.MULTIPART_FORM_DATA.equals(entity.getMediaType(), true)) {
  Request restletRequest = getRequest();
  HttpServletRequest servletRequest =
 ServletUtils.getRequest(restletRequest);
  ServletFileUpload upload = new ServletFileUpload();
  FileItemIterator fileIterator =
 upload.getItemIterator(servletRequest);
  while (fileIterator.hasNext()) {
  FileItemStream item = fileIterator.next();
  String name = item.getName();
  byte[] content =
 ByteStreams.toByteArray(item.openStream());
 // do stuff with content
  }
  } else {
  setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
  }
  } else {
  setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
  }
  }

 Perhaps you can share this with Restlet documentation so community would
 benefit to this code. Or perhaps you can see some issues with the code.

 --

 http://restlet.tigris.org/ds/viewMessage.do?dsForumId

Re: Trouble going from 2.2 to 2.3

2014-12-19 Thread Thierry Boileau
Hi Tim,

I'm afraid I've taken all alone the decision to remove these files as they
appeared useless to me. I feel really sorry about that.
I revert back these changes on the 2.3 and master branches: that is to say
the JEE edition provides these connectors. However, I wonder if we have to
register these connectors by default, what is your thinking about that?

And unfortunately, I won't be able to package a 2.3.1 release soon, I can
achieve this on the 29th of December.


Best regards,
Thierry Boileau



2014-12-19 20:34 GMT+01:00 Tim Peierls t...@peierls.net:

 The default connectors for various editions have changed between 2.2 and
 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers
 HTTP or HTTPS server helpers; JSE still does.

 Assuming this was intentional and not an oversight, the change causes
 problems for me. For several versions now I've been able to maintain one
 build that works both as a standalone deployment and when embedded in a WAR
 for deployment in a production server running Tomcat. I've used the JEE
 edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

 (Why use Tomcat at all? There are better connectors for production
 purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

 With this latest change, however, the standalone deployment no longer
 works. I get message: No available server connector supports the required
 protocols: 'HTTP' Please add the jar of a matching connector to your
 classpath.
 https://github.com/restlet/restlet-framework-java/blob/09c78b4737c1eda45a276dc284d4ffee61f8efca/modules/org.restlet/src/org/restlet/engine/Engine.java#L650-L663

 It's because no HttpServerHelper has been registered in these lines
 https://github.com/restlet/restlet-framework-java/blob/09c78b4737c1eda45a276dc284d4ffee61f8efca/modules/org.restlet/src/org/restlet/engine/Engine.java#L896-L901
 for JEE (the jee token was added to the #ifndef list only a few days
 ago). I'd be happy to add the jar of a matching connector if there was one
 that the JEE edition supported, but the obvious candidates, Jetty and
 Simple, don't seem to be available for that edition.

 I'd be happy to switch to the JSE edition, but then I wouldn't be able to
 compile against org.restlet.ext.servlet.

 There's an existing issue which is vaguely related:

 https://github.com/restlet/restlet-framework-java/issues/876

 I'm not filing my own issue yet, because I don't see it as a bug, but I'd
 like advice on what to do here. I'd prefer not to have to make separate
 builds -- it was a really nice property that I could run the same code and
 libraries either standalone or deployed as a WAR.

 --tim




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

Re: Trouble going from 2.2 to 2.3

2014-12-19 Thread Thierry Boileau
wow, I need vacations!
The fix is exactly: register these default connectors.

Best regards,
Thierry Boileau


2014-12-19 21:02 GMT+01:00 Thierry Boileau tboil...@restlet.com:

 Hi Tim,

 I'm afraid I've taken all alone the decision to remove these files as they
 appeared useless to me. I feel really sorry about that.
 I revert back these changes on the 2.3 and master branches: that is to say
 the JEE edition provides these connectors. However, I wonder if we have to
 register these connectors by default, what is your thinking about that?

 And unfortunately, I won't be able to package a 2.3.1 release soon, I can
 achieve this on the 29th of December.


 Best regards,
 Thierry Boileau



 2014-12-19 20:34 GMT+01:00 Tim Peierls t...@peierls.net:

 The default connectors for various editions have changed between 2.2 and
 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers
 HTTP or HTTPS server helpers; JSE still does.

 Assuming this was intentional and not an oversight, the change causes
 problems for me. For several versions now I've been able to maintain one
 build that works both as a standalone deployment and when embedded in a WAR
 for deployment in a production server running Tomcat. I've used the JEE
 edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

 (Why use Tomcat at all? There are better connectors for production
 purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

 With this latest change, however, the standalone deployment no longer
 works. I get message: No available server connector supports the
 required protocols: 'HTTP' Please add the jar of a matching connector to
 your classpath.
 https://github.com/restlet/restlet-framework-java/blob/09c78b4737c1eda45a276dc284d4ffee61f8efca/modules/org.restlet/src/org/restlet/engine/Engine.java#L650-L663

 It's because no HttpServerHelper has been registered in these lines
 https://github.com/restlet/restlet-framework-java/blob/09c78b4737c1eda45a276dc284d4ffee61f8efca/modules/org.restlet/src/org/restlet/engine/Engine.java#L896-L901
 for JEE (the jee token was added to the #ifndef list only a few days
 ago). I'd be happy to add the jar of a matching connector if there was one
 that the JEE edition supported, but the obvious candidates, Jetty and
 Simple, don't seem to be available for that edition.

 I'd be happy to switch to the JSE edition, but then I wouldn't be able to
 compile against org.restlet.ext.servlet.

 There's an existing issue which is vaguely related:

 https://github.com/restlet/restlet-framework-java/issues/876

 I'm not filing my own issue yet, because I don't see it as a bug, but I'd
 like advice on what to do here. I'd prefer not to have to make separate
 builds -- it was a really nice property that I could run the same code and
 libraries either standalone or deployed as a WAR.

 --tim




 --
 *Thierry Boileau, Mr B*
 +1 (408) 387-3184 • tboil...@restlet.com

 http://restlet.com/
 6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

Re: Trouble going from 2.2 to 2.3

2014-12-19 Thread Thierry Boileau
Hi Tim,

I think it is not called early enough. It should be done before the
Component.getServers() method is called.

--
Thierry Boileau

2014-12-19 21:10 GMT+01:00 Tim Peierls t...@peierls.net:

 I tried adding this line:

 Engine.getInstance().getRegisteredServers().add(
 new org.restlet.engine.connector.HttpServerHelper(null));

 but it didn't seem to work -- maybe I didn't call it early enough. As far
 as you know, though, that's all I should have to do?

 On Fri, Dec 19, 2014 at 3:08 PM, Thierry Boileau tboil...@restlet.com
 wrote:

 wow, I need vacations!
 The fix is exactly: register these default connectors.

 Best regards,
 Thierry Boileau


 2014-12-19 21:02 GMT+01:00 Thierry Boileau tboil...@restlet.com:

 Hi Tim,

 I'm afraid I've taken all alone the decision to remove these files as
 they appeared useless to me. I feel really sorry about that.
 I revert back these changes on the 2.3 and master branches: that is to
 say the JEE edition provides these connectors. However, I wonder if we have
 to register these connectors by default, what is your thinking about that?

 And unfortunately, I won't be able to package a 2.3.1 release soon, I
 can achieve this on the 29th of December.


 Best regards,
 Thierry Boileau



 2014-12-19 20:34 GMT+01:00 Tim Peierls t...@peierls.net:

 The default connectors for various editions have changed between 2.2
 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer
 registers HTTP or HTTPS server helpers; JSE still does.

 Assuming this was intentional and not an oversight, the change causes
 problems for me. For several versions now I've been able to maintain one
 build that works both as a standalone deployment and when embedded in a WAR
 for deployment in a production server running Tomcat. I've used the JEE
 edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

 (Why use Tomcat at all? There are better connectors for production
 purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

 With this latest change, however, the standalone deployment no longer
 works. I get message: No available server connector supports the
 required protocols: 'HTTP' Please add the jar of a matching connector to
 your classpath.
 https://github.com/restlet/restlet-framework-java/blob/09c78b4737c1eda45a276dc284d4ffee61f8efca/modules/org.restlet/src/org/restlet/engine/Engine.java#L650-L663

 It's because no HttpServerHelper has been registered in these lines
 https://github.com/restlet/restlet-framework-java/blob/09c78b4737c1eda45a276dc284d4ffee61f8efca/modules/org.restlet/src/org/restlet/engine/Engine.java#L896-L901
 for JEE (the jee token was added to the #ifndef list only a few days
 ago). I'd be happy to add the jar of a matching connector if there was one
 that the JEE edition supported, but the obvious candidates, Jetty and
 Simple, don't seem to be available for that edition.

 I'd be happy to switch to the JSE edition, but then I wouldn't be able
 to compile against org.restlet.ext.servlet.

 There's an existing issue which is vaguely related:

 https://github.com/restlet/restlet-framework-java/issues/876

 I'm not filing my own issue yet, because I don't see it as a bug, but
 I'd like advice on what to do here. I'd prefer not to have to make separate
 builds -- it was a really nice property that I could run the same code and
 libraries either standalone or deployed as a WAR.

 --tim




 --
 *Thierry Boileau, Mr B*
 +1 (408) 387-3184 • tboil...@restlet.com

 http://restlet.com/
 6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France




 --
 *Thierry Boileau, Mr B*
 +1 (408) 387-3184 • tboil...@restlet.com

 http://restlet.com/
 6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France




-- 
*Thierry Boileau, Mr B*
+1 (408) 387-3184 • tboil...@restlet.com

http://restlet.com/
6 Rue Rose Dieng-Kuntz • Nantes, 44300 • France

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

Re: maven dependencies

2014-09-16 Thread Thierry Boileau
Hello Laurent,

we are looking at this, a new release will be out before the end of the
week.

Best regards,
Thierry Boileau

2014-09-12 18:26 GMT+02:00 Laurent Rustuel laurent.rust...@genesys.com:

 Hello,
 I'm wanted to try the swagger extension, and thus created a maven
 project with dependency to repository http://maven.restlet.org. When
 building with
 dependency
 groupIdorg.restlet.jee/groupId
 artifactIdorg.restlet/artifactId
 version2.3-SNAPSHOT/version
 /dependency
 I've the following error :
 [ERROR] Failed to execute goal on project ucs-web: Could not resolve
 dependencies [...]
 collect dependencies at
 org.restlet.jee:org.restlet.ext.swagger:jar:2.3-SNAPSHOT -

 org.restlet.jee:org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts:jar:${lib-e4-version}:
 Failed to read artifact descriptor for

 org.restlet.jee:org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts:
 jar:${lib-e4-version}: Could not transfer artifact

 org.restlet.jee:org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts:pom:${lib-e4-version}
 from/to maven-restlet (http://maven.restlet.org): Illegal character in
 path at index 103:

 http://maven.restlet.org/org/restlet/jee/org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts/${lib-e4-version}/org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts-${lib-e4-version}.pom


 If I set this version
 mvn compile -Dlib-e4-version=0.12.RC1
 I then got the following error :

 [ERROR] Failed to execute goal on project test-swagger: Could not
 resolve dependencies for project
 com.genesys.ucs.esp:ucs-web:jar:9.0-SNAPSHOT: Failed to collect
 dependencies at org.restlet.jee:org.restlet.ext.swagger:jar:2.3-SNAPSHOT
 - javax.ws.rs:javax.ws.rs-api:jar:2.0.0: Failed to read artifact
 descriptor for javax.ws.rs:javax.ws.rs-api:jar:2.0.0: Could not transfer
 artifact javax.ws.rs:javax.ws.rs-api:pom:2.0.0 from/to maven1-java
 (http://download.java.net/maven/1): No connector available to access
 repository maven1-java (http://download.java.net/maven/1) of type legacy
 using the available factories WagonRepositoryConnectorFactory - [Help 1]

 I'm not sur if this is an incorrect settings in my project or if this is
 an issue.

 Regards,
 Laurent.

 --
 Laurent Rustuel,
 Software Engineer
 Genesys Telecommunications Lab
 Askell Park – 90 Rue Charles Nungesser
 ZAC Prat Pip Nord
 29490 Guipavas, France
 T:  +33 2 57 40 13 37

 --

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


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

RE: Re: Restlet 2.2.1 only serves from one thread

2014-08-25 Thread Thierry Boileau
Hello Robert,

from the beginning of Restlet Framework, our most important aim is to provide a 
clear and rich API for developing both client and server side applications.
Implementation comes later and we're fine to take shortcuts and to leverage 
well-established frameworks such as Jetty (which was the first HTTP server 
connector shipped with Restlet).

Of course, we had, and yet still have, the intention to provide 
production-ready home made client and server HTTP connectors. The first 
implementations relied on the classic basic IO, then an effort was made to 
develop full NIO connectors, because we saw that as an opportunity to provide 
scalable connectors, asynchronicity, etc. At a time, we recognized that we were 
lacking time or contributions in order to fully achieve this task (even if we 
think we are close to it), and thus decided to export this into the 
org.restlet.ext.nio module, and replace it with the com.sun implementations 
internally. In addition, constantly and transparently we always claimed that 
these internal connectors are fine for development environment not for 
production.

I'm not sure to give you the best answer, feel free to ask for more, or to help 
us reconsider the current position.

Best regards,
Thierry Boileau
PS: I've just committed code in the 2.2 and 2.3 branches, in order to add a 
decent thread pool to the internal HTTP server connector.

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


Re: Restlet 2.2.1 only serves from one thread

2014-08-06 Thread Thierry Boileau
Hello Robert,

I've added an issue for that question with a few line for analysis:
https://github.com/restlet/restlet-framework-java/issues/937
This issue concerns the internal HTTP server connector which can be used
for development, but not for production.

You can use the Jetty and Simple connectors which are right choices for
production environments.

Best regards,
Thierry Boileau


2014-08-06 6:17 GMT+02:00 Robert Barnett barn...@rice.edu:

 I had a very strange latency issue pop up today which I have isolated to
 an apparent issue with 2.2.1.  I can take the Hello World stand alone
 example from Restlet.com and modify the Resource to be:

 package firstSteps;

 import org.restlet.resource.Get;
 import org.restlet.resource.ServerResource;

 public class HelloWorldResource extends ServerResource {

 @Get
 public String represent() throws InterruptedException
 {
 System.out.println(Thread.currentThread().getId());
 Thread.sleep(1);
 return hello, world;
 }
 }

 I then take two browsers, Firefox and Chrome, and make a request from
 each.  Firefox shows Hello World after 10 seconds and Chrome after 20.
  Looking at the console I see that both requests were serviced by the same
 thread.  I can the take my load generator, jMeter, and send a lot of
 requests in parallel to Restlet.  Restlet processes them one at a time and
 always with the same thread. It is as if the default thread pool size is
 one. When I downgrade to 2.1 and run the same tests, the issue goes away
 with a variety of threads servicing the requests in parallel.

 Please advise.

 --

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


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

Re: Re: Put with no content

2014-07-15 Thread Thierry Boileau
Hello,

Restlet now complains that the content length must be greater than or
equal to zero.
As pointed out by other posters, this is an artificial constraint imposed
by Restlet. In many cases, the URI itself carries sufficient information.
If I have a look at the HTTP specifications (
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13), I'm
inclined to say that things are quite clear:

Content-Length= Content-Length : 1*DIGIT

Where digit is defined as follow (
http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2):

 DIGIT  = any US-ASCII digit 0..9

Which is only an answer to this single mail.


Don't worry, I don't forget the global topic, but unfortunately I need a
little bit time to answer you.

Best regards,
Thierry Boileau


2014-07-14 17:20 GMT+02:00 Frank Kolnick reallyfr...@hotmail.com:

 I tried setting the content length to -1, as per MSDN:
 The ContentLength property contains the value of the Content-Length
 header returned with the response. If the Content-Length header is not set
 in the response, ContentLength is set to the value -1.

 Restlet now complains that the content length must be greater than or
 equal to zero.

 As pointed out by other posters, this is an artificial constraint imposed
 by Restlet. In many cases, the URI itself carries sufficient information.

 I.e., please stop doing that :-)

 --

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


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

Re: Getting Started with Restlet

2014-07-11 Thread Thierry Boileau
Hello,

you can find:
 - a first tutorial here: http://restlet.com/learn/tutorial/2.2/
 - a hello world application here :
http://restlet.com/learn/guide/2.2/editions/jse/
 - a full running sample code running on GAE with android, gwt and classic
JVM client codes here:
http://restlet.com/learn/guide/2.2/introduction/first-steps/first-application

best regards,
Thierry Boileau




2014-07-11 10:27 GMT+02:00 Tejas Dharamsi m...@tejasdharamsi.in:

 I want to use Restlet framework for making a rest api which will act as an
 interface for my java back end and angular js front end.
 Can you post an example which can help me move swiftly to  achieve my goals

 I want data encoding in JSON.

 Thanks.

 do revert back at the earliest.

 Dharamsi

 --

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


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

Re: Put with no content

2014-07-11 Thread Thierry Boileau
Hello,

I dont see clearly the link between the fact that the client sends a PUT
request without content and the fact that the client receives a 204 - No
content response.
Could you describe the resource that responses to the call, especially the
method that handles the PUT request?

Having said that, I've tested (on both 2.3 and 2.2 branches) the following
annotated method. It accepts the empty entity and converts it as a null
bean, and returns a 200 response.

@Put
public String hello(Contact contact) {
System.out.println(contact);
return hello, world;
}

With the following code, I notice that the received contact is null, and
that the response is 204 - no content which is correct:
@Put
public Contact yop(Contact contact) {
System.out.println(contact);
return contact;
}

best regards,
Thierry Boileau



2014-07-11 17:50 GMT+02:00 Frank Kolnick reallyfr...@hotmail.com:

 A previous thread seems to indicate that this has been fixed, but I still
 get a No Content error when I send a PUT to a Restlet-based server. (The
 client uses a library other than Restlet.)

 I have the latest stable release of Restlet.

 Is there a work-around? Preferably not one that requires inserting dummy
 content.

 --

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


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

Re: Put - method not allowed

2014-06-27 Thread Thierry Boileau
Hello Andre,

I send you a sample Eclipse project with your code.
I order to make it run, you need at least the following jars:
 - org.restlet.jar (core module)
 - org.restlet.ext.json.jar (json extension that allows automatic
serialization/deserialization)
 - org.json.jar (dependency)


Best regards,
Thierry Boileau


2014-06-27 14:51 GMT+02:00 AAlefeld aalef...@gmail.com:

 Hi,

 I am a newbie to restlet api and I started using restlet 2.2.1 and have
 a running restlet app with resources that can be accessed via GET
 request. They return a json string, e.g. localhost:8182/myresource
 gives a list like [ res1, res2, res3 ]

 I wanted to add a put method now to store/modify a resource and added

 @Put
 public void storeResource(JSONObject json) {
  System.out.println(Put resource:  + json);
  // real handling goes here
 }

 rebuilt and restarted the server

 curl -v http://localhost:8182/create -X PUT -H Content-Type:
 application/json -d '{res3: {name:test, setting:ud}}'

 I would expect to get the object printed out on the server side, instead
 I run always into:
 ...
  HTTP/1.1 405 Method Not Allowed
 ...
 p style=font-size: 1.2em;font-weight: bold;margin: 1em 0px;Method
 Not Allowed/p
 pThe method specified in the request is not allowed for the resource
 identified by the request URI/p
 ...

 In the javadocs I read something about the default implementation of put
 in Representation to always set
 Status.CLIENT_ERROR_METHOD_NOT_ALLOWED

 How can I achieve that my PUT/DELETE etc. requests are accepted ?

 thanks for any help,
 Andre

 --

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


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

Re: update agent.properties file

2014-05-08 Thread Thierry Boileau
Hello Daz,

This one should work.
Mozilla/{mozillaVersion} ({osData}; {agentOs})
AppleWebKit/{appleWebKitVersion} ({appleWebKitComment}) Chrome/{chromeData}
Safari/{safariData} {agentName}/{agentVersion} {facultativeData}

I've noticed two mistakes in your template:
1/ this part of the template : ({osData}Windows; U; {agentOs})
can't match Windows NT 6.1; WOW64
2/ the template is case sensitive: AppleWebKit instead of AppleWebkit

Could you provide an updated agent.properties file?
I've updated with your template, and I've added an issue for that:
https://github.com/restlet/restlet-framework-java/issues/915


Best regards,
Thierry Boileau


2014-05-08 13:40 GMT+02:00 Daz dazito1...@gmail.com:

 Hi,

 Could you provide an updated agent.properties file?

 It looks kinda outdated.

 Example: there is the new Opera that is detected as Chrome and not Opera.

 I tried to manually update the agent.properties file to reflect the new
 Opera version but to no success. Still detected as Chrome.

 Here is what I added to agent.properties file to reflect the new Opera:

 #NewOpera for Windows
 Mozilla/{mozillaVersion} ({osData}Windows; U; {agentOs})
 AppleWebkit/{appleWebKitVersion} (appleWebKitComment) Chrome/{chromeData}
 Safari/{safariData} {agentName}/{agentVersion}


 What did I do wrong?

 From my tests (fresh install) on Windows, the new Opera user agent is:
 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
 Chrome/34.0.1847.132 Safari/537.36 OPR/21.0.1432.57 (Edition Campaign 48)


 Thanks.

 --

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


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

Re: Transparent reverse proxying using org.restlet.routing.Redirector

2014-05-06 Thread Thierry Boileau
Hello all,

I'm having a look at it.

Best regards,
Thierry Boileau


2014-05-01 12:27 GMT+02:00 Arjohn Kampman arjohn.kamp...@vound-software.com
:

 Any thoughts on the encoding related bug in Redirector?

 --

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


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

RE: Re: HTTPS Server with Jetty Connector, SSLv3

2014-05-01 Thread Thierry Boileau
Hello,

thanks a lot for reporting this issue. I've synchronized the code and javadocs.

Best regards,
Thierry Boileau

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


Re: HTTPS Server with Jetty Connector, SSLv3

2014-04-07 Thread Thierry Boileau
Hi,

I've entered an issue for that:
https://github.com/restlet/restlet-framework-java/issues/903

Best regards,
Thierry Boileau


2014-04-07 7:54 GMT+02:00 Thierry Boileau tboil...@restlet.com:

 Hello,

 for a quick workaround, set the keyManagerAlgorithm property:
 sslContextFactory.setKeyManagerAlgorithm(SunX509);

 I think there is a bug here, because this should be the default value.

 Best regards,
 Thierry Boileau




 2014-04-05 6:42 GMT+02:00 cdu cdu.a...@gmail.com:

 Trying to set up a Restlet HTTPS Server with a Jetty Connector.  here's
 what
 I have coded up:

 Component home = new Component();

 Server homeServer = new Server(
 home.getContext().createChildContext(),
 Protocol.HTTPS, port, home);
 DefaultSslContextFactory sslContextFactory = new
 DefaultSslContextFactory();
 sslContextFactory.setProtocol(SSL);
 sslContextFactory.setKeyStorePath(certPath);
 sslContextFactory.setKeyStorePassword(keystore_pwd);
 sslContextFactory.setKeyStoreKeyPassword(key_pwd);
 sslContextFactory.setKeyStoreType(JKS);
 homeServer.getContext().getAttributes().put(sslContextFactory,
 sslContextFactory);


 When starting up the server, I get the error below which I can't figure.
 Any help please?  Thx very much in advance!

 Apr 04, 2014 9:39:57 PM org.restlet.ext.jetty.HttpsServerHelper
 createConnector
 WARNING: Unable to create the Jetty SSL context factory
 java.lang.NullPointerException
 at java.security.Provider$ServiceKey.init(Provider.java:517)
 at java.security.Provider$ServiceKey.init(Provider.java:510)
 at java.security.Provider.getService(Provider.java:684)
 at sun.security.jca.ProviderList.getService(ProviderList.java:331)
 at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
 at
 javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:139)
 at

 org.restlet.ext.ssl.DefaultSslContextFactory.createSslContext(DefaultSslContextFactory.java:325)
 at

 org.restlet.ext.jetty.internal.RestletSslContextFactory.init(RestletSslContextFactory.java:66)
 at

 org.restlet.ext.jetty.HttpsServerHelper.createConnector(HttpsServerHelper.java:106)
 at
 org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:393)
 at org.restlet.Server.start(Server.java:590)
 at org.restlet.Component.startServers(Component.java:611)
 at org.restlet.Component.start(Component.java:538)
 [snip]

 java.lang.NullPointerException
 at

 org.restlet.ext.jetty.JettyServerHelper.configure(JettyServerHelper.java:203)
 at
 org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:394)
 at org.restlet.Server.start(Server.java:590)
 at org.restlet.Component.startServers(Component.java:611)
 at org.restlet.Component.start(Component.java:538)
 [snip]





 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/HTTPS-Server-with-Jetty-Connector-SSLv3-tp7579108.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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




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

Re: HTTPS Server with Jetty Connector, SSLv3

2014-04-06 Thread Thierry Boileau
Hello,

for a quick workaround, set the keyManagerAlgorithm property:
sslContextFactory.setKeyManagerAlgorithm(SunX509);

I think there is a bug here, because this should be the default value.

Best regards,
Thierry Boileau




2014-04-05 6:42 GMT+02:00 cdu cdu.a...@gmail.com:

 Trying to set up a Restlet HTTPS Server with a Jetty Connector.  here's
 what
 I have coded up:

 Component home = new Component();

 Server homeServer = new Server(
 home.getContext().createChildContext(),
 Protocol.HTTPS, port, home);
 DefaultSslContextFactory sslContextFactory = new
 DefaultSslContextFactory();
 sslContextFactory.setProtocol(SSL);
 sslContextFactory.setKeyStorePath(certPath);
 sslContextFactory.setKeyStorePassword(keystore_pwd);
 sslContextFactory.setKeyStoreKeyPassword(key_pwd);
 sslContextFactory.setKeyStoreType(JKS);
 homeServer.getContext().getAttributes().put(sslContextFactory,
 sslContextFactory);


 When starting up the server, I get the error below which I can't figure.
 Any help please?  Thx very much in advance!

 Apr 04, 2014 9:39:57 PM org.restlet.ext.jetty.HttpsServerHelper
 createConnector
 WARNING: Unable to create the Jetty SSL context factory
 java.lang.NullPointerException
 at java.security.Provider$ServiceKey.init(Provider.java:517)
 at java.security.Provider$ServiceKey.init(Provider.java:510)
 at java.security.Provider.getService(Provider.java:684)
 at sun.security.jca.ProviderList.getService(ProviderList.java:331)
 at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
 at
 javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:139)
 at

 org.restlet.ext.ssl.DefaultSslContextFactory.createSslContext(DefaultSslContextFactory.java:325)
 at

 org.restlet.ext.jetty.internal.RestletSslContextFactory.init(RestletSslContextFactory.java:66)
 at

 org.restlet.ext.jetty.HttpsServerHelper.createConnector(HttpsServerHelper.java:106)
 at
 org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:393)
 at org.restlet.Server.start(Server.java:590)
 at org.restlet.Component.startServers(Component.java:611)
 at org.restlet.Component.start(Component.java:538)
 [snip]

 java.lang.NullPointerException
 at

 org.restlet.ext.jetty.JettyServerHelper.configure(JettyServerHelper.java:203)
 at
 org.restlet.ext.jetty.JettyServerHelper.start(JettyServerHelper.java:394)
 at org.restlet.Server.start(Server.java:590)
 at org.restlet.Component.startServers(Component.java:611)
 at org.restlet.Component.start(Component.java:538)
 [snip]





 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/HTTPS-Server-with-Jetty-Connector-SSLv3-tp7579108.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

Re: Java Serialization issues on Restlet versions above 2.1-M4

2014-03-17 Thread Thierry Boileau
Hello Raphaele,

As the ObjectRepresentation wraps another Representation to deserialize,
and because the 2 distinct formats are supported, you should help the
objectRepresentation to know which deserializer is going to be used.
If you are using the following constructor, juste set the media type of the
wrapped representation

public ObjectRepresentation(Representation)


best regards,
Thierry Boileau




2014-02-26 18:06 GMT+01:00 Raffaele Gravina raffaele.grav...@gmail.com:

 Dear All,

 I'm trying to run the very simple Restlet sample app available here
 http://restlet.org/learn/guide/2.2/introduction/first-steps/first-application

 I'm trying to run the client on an Android device, but I get the following
 error:
 Unable to convert a [application/json,UTF-8] representation into an object
 of class org.restlet.example.common.Contact
 java.io.IOException: Unable to create the Object representation

 org.restlet.engine.converter.DefaultConverter.toObject(DefaultConverter.java:291)
 org.restlet.service.ConverterService.toObject(ConverterService.java:170)
 org.restlet.resource.Resource.toObject(Resource.java:828)

 org.restlet.engine.resource.ClientInvocationHandler.invoke(ClientInvocationHandler.java:240)
 $Proxy7.retrieve(Native Method)

 org.restlet.example.serialisation.android.activity.ContactActivity$2.run(ContactActivity.java:142)
 java.lang.Thread.run(Thread.java:1096)
 java.lang.IllegalArgumentException: The serialized representation must
 have this media type: application/x-java-serialized-object or this one:
 application/x-java-serialized-object+xml

 org.restlet.representation.ObjectRepresentation.init(ObjectRepresentation.java:204)

 org.restlet.representation.ObjectRepresentation.init(ObjectRepresentation.java:133)

 org.restlet.representation.ObjectRepresentation.init(ObjectRepresentation.java:114)

 org.restlet.engine.converter.DefaultConverter.toObject(DefaultConverter.java:288)


 The only way to make this app working is to use the Restlet 2.1-M4
 version. I tried with 2.2-RC2 and even with the stable 2.1.7 Restlet
 release.

 I understand the app has been tested with Restlet Framework 2.1 Milestone
 4, but it sounds too weird to me that a later stable release such the
 2.1.7 goes nuts on a trivial example like this one!

 The app itself is so simple that I cannot see where the problem might ever
 rely, except for a bug of the restlet library itself.
 The only other option I can imagine is that after restlet 2.1-m4, in order
 to have java serialization working fine, there must be some additional
 piece of code to add in the client and/or the server that was not necessary
 with 2.1-m4.


 Any comments or suggestions will be greatly appreciated.

 Best,

 Raffaele Gravina

 --

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


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

Re: Entity to large

2014-02-28 Thread Thierry Boileau
Hello Adrien,

could you precise the kind of remote server you are communicating with?
what is the size of the file? What kind of client HTTP connector are you
using?
It seems that the server estimates the entity is too large and decide to
cut the communication.

Best regards,
Thierry Boileau


2014-02-28 15:35 GMT+01:00 adrien ruffie a.ruf...@e-deal.com:

 Sorry I have forgotten this log:

 org.restlet.resource.ResourceException: Request Entity Too Large
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:858)
 ~[org.restlet-2.0.8.jar:na]
 at
 org.restlet.resource.ClientResource.post(ClientResource.java:1197)
 ~[org.restlet-2.0.8.jar:na]


 


 Hello all,

 I try to my webapp to transfer a file over a remote server, but I get the
 following error:

 org.restlet.resource.ResourceException: Communication Error
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:858)
 ~[org.restlet-2.0.8.jar:na]
 at
 org.restlet.resource.ClientResource.post(ClientResource.java:1197)
 ~[org.restlet-2.0.8.jar:na]


 Any one have an idea of the problem ?

 Great thank and best regards

 Adrien Ruffié

 --

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


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

Re: Entity to large

2014-02-28 Thread Thierry Boileau
Hi Adrien,

My webapp which send the file is running on a Tomcat, and the webapp which
receive the  file also running on another Tomcat.
What happen if you try to send the file using another client such as curl?
For example, for a PUT request

curl -X PUT -H Content-type: your file media type --data-binary @path
to your file http://example.com:port/path/to/resource


How I can check the kind of client HTTP Connection ?
You can have an idea by having a look at the list of restlet modules in the
web-inf/lib directory. Can you send the list of restlet framework are you
using?

Best regards,
Thierry Boileau





2014-02-28 15:58 GMT+01:00 adrien ruffie a.ruf...@e-deal.com:

 Thank you for your first response,



 I try to upload several picture with 53ko, 15ko, 226ko, 9ko size but not
 very large size like 10mo ...



 My webapp which send the file is running on a Tomcat, and the webapp which
 receive the  file also running on another Tomcat.



 How I can check the kind of client HTTP Connection ?



 Bien cordialement,

 *Adrien Ruffié*
 LD : +33 1 73 03 29 50
 Tél : +33 1 73 03 29 80

 *E-DEAL* http://www.e-deal.com/
 Innover la Relation Client



 *De :* Thierry Boileau [mailto:tboil...@restlet.com]
 *Envoyé :* vendredi 28 février 2014 15:50
 *À :* discuss@restlet.tigris.org
 *Objet :* Re: Entity to large



 Hello Adrien,

 could you precise the kind of remote server you are communicating with?
 what is the size of the file? What kind of client HTTP connector are you
 using?

 It seems that the server estimates the entity is too large and decide to
 cut the communication.

 Best regards,

 Thierry Boileau



 2014-02-28 15:35 GMT+01:00 adrien ruffie a.ruf...@e-deal.com:

 Sorry I have forgotten this log:

 org.restlet.resource.ResourceException: Request Entity Too Large

 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:858)
 ~[org.restlet-2.0.8.jar:na]
 at
 org.restlet.resource.ClientResource.post(ClientResource.java:1197)
 ~[org.restlet-2.0.8.jar:na]


 



 Hello all,

 I try to my webapp to transfer a file over a remote server, but I get the
 following error:

 org.restlet.resource.ResourceException: Communication Error
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:858)
 ~[org.restlet-2.0.8.jar:na]
 at
 org.restlet.resource.ClientResource.post(ClientResource.java:1197)
 ~[org.restlet-2.0.8.jar:na]


 Any one have an idea of the problem ?

 Great thank and best regards

 Adrien Ruffié

 --


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




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

Re: Restlet returns 404 error when http request line contains an absolute URI with an https scheme

2014-02-20 Thread Thierry Boileau
Hello John,

I've entered a ticket for this:
https://github.com/restlet/restlet-framework-java/issues/846

Best regards,
Thierry Boileau


2014-02-19 2:05 GMT+01:00 John Graf jg...@hp.com:

 We have a client for our Restlet web service that puts the absolute URI in
 the http GET request line, which is a little non-standard.  Clients are
 supposed to send relative URIs unless they are talking to a proxy.
  Nevertheless, http servers are supposed to handle this case and Restlet
 does not.  Actually it handles it as long as it isn't an https URI.

 To reproduce this, connect to a local instance of a Restlet server:

 telnet localhost 8080
 GET https://localhost/ HTTP/1.1
 Host: localhost

 HTTP/1.1 404 Not Found
 Content-Length: 439
 Content-Type: text/html; charset=UTF-8
 Date: Sat, 15 Feb 2014 00:53:17 GMT
 Server: Restlet-Framework/2.1.1

 html
 head
titleStatus page/title
 /head
 body style=font-family: sans-serif;
 p style=font-size: 1.2em;font-weight: bold;margin: 1em 0px;Not
 Found/p
 pThe server has not found anything matching the request URI/p
 pYou can get technical details a href=
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5
 here/a.br
 Please continue your visit at our a href=/home page/a.
 /p
 /body
 /html

 I tried to work around this with a Filter but my beforeHandle() is never
 called.  The error seems to occur before any Filters are invoked.

 The problem seems to be in
 org.restlet.data.Reference.getRemainingPart(boolean, boolean):

 public String getRemainingPart(boolean decode, boolean query) {
   String result = null;
   final String all = toString(query, false);

   if (getBaseRef() != null) {
 final String base = getBaseRef().toString(query, false);

 if ((base != null)  all.startsWith(base)) {
   result = all.substring(base.length());
 }
   } else {
 result = all;
   }

   return decode ? decode(result) : result;
 }

 It is returning null because all.startsWith(base) is false; all has the
 https scheme and base has the http scheme.  Should I enter a defect for
 this?

 We are running Restlet v2.1.1.

 --

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


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

Re: Serving static content

2014-02-04 Thread Thierry Boileau
Hello Daz,

I've answered in the StackOverFlow forum.

Best regards,
Thierry Boileau


2014-02-04 Daz dazito1...@gmail.com:

 I've made this question on stackoverflow but to no success yet.
 (Here's the link:
 http://stackoverflow.com/questions/21533787/restlet-serving-static-content-android)

 I'm using Restlet in Android.

 I've the REST part working fine but now I need to serve static pages to
 the user and here is where I'm stuck.

 I've the following router:
 this.attach(/web_resources/{uid}, staticContentRestlet);

 If the user goes to http://10.17.1.72:8080/web_resources/index.html
 which is my phone's ip, it will get 200 status for the index file, as
 expected, but it will get 404 on all request to get the CSS file,
 javascript file and so on... They are all placed in web_resources/js/,
 web_resources/css/ and web_resources/img/ folders.

 While googling around I found out this bug report:
 http://restlet.tigris.org/issues/show_bug.cgi?id=1240

 And I tried to use wildcards to load up all the content.
 So I added the following code:
 this.attach(/web_resources/{part1}/{part2*}, testRestlet);

 But if I load up the following url:
 /web_resources/js/transfer/services.js
 it returns a 404 for the service.js file

 Using only: this.attach(/web_resources/{part1*}, testRestlet);
 doesn't solve the problem...

 So it seems that the * wildcard does nothing. Maybe the bug wasn't fixed
 yet? Or am I missing something here?

 --

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


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

Re: Restlet client version 2.1.6, SSL configuration on Android

2014-01-13 Thread Thierry Boileau
Hello Mark,

I'm also trying to figure out what happens. I'll keep you informed.

Best regards,
Thierry


2014/1/12 Mark Petrovic mspetro...@gmail.com

 Well, I'm making progress.  My original code failed to expand the Android
 R resource id's into actual strings.  So my URL was horribly mangled.  I
 fixed that.

 But I still see this exception when connecting over https:

  Caused by: Internal Connector Error (1002) - No available client
 connector supports the required protocol: 'HTTPS'. Please add the JAR of a
 matching connector to your classpath.
 at
 org.restlet.resource.ClientResource.doError(ClientResource.java:612)
 at
 org.restlet.resource.ClientResource.handleInbound(ClientResource.java:1202)
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:1026)
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:968)
 at
 org.restlet.resource.ClientResource.get(ClientResource.java:680)
 at
 com.homosuperiorus.clips.clients.TransmitsClient.getTransmits(TransmitsClient.java:27)
 at
 com.homosuperiorus.clips.models.TransmitsSource.getTransmits(TransmitsSource.java:38)
 at
 com.homosuperiorus.clips.fragment.ClipsListFragment$GetTransmitsTask.doInBackground(ClipsListFragment.java:93)
 at
 com.homosuperiorus.clips.fragment.ClipsListFragment$GetTransmitsTask.doInBackground(ClipsListFragment.java:83)
 at android.os.AsyncTask$2.call(AsyncTask.java:288)
 at java.util.concurrent.FutureTask.run(FutureTask.java:237)
 at
 android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
 at java.lang.Thread.run(Thread.java:841)

 Here is my latest dependency list:

 dependencies {
 compile group: 'com.google.android', name: 'support-v4', version: 'r7'
 compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
 compile group: 'joda-time', name: 'joda-time', version: 2.3
 compile group: org.restlet.android, name: org.restlet, version:
 versions.restlet
 compile group: org.restlet.android, name: org.restlet.ext.jackson,
 version: versions.restlet
 compile group: org.restlet.android, name: org.restlet.ext.net,
 version: versions.restlet
 }

 Anybody?

 --

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


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

Re: Restlet, jackson and @JsonTypeInfo

2014-01-07 Thread Thierry Boileau
Hello,

I think that the following will also work:
@Get
public ArrayListSiteDAO myGet() {
...
}

Best regards,
Thierry Boileau


2014/1/7 Tim Peierls t...@peierls.net

 One problem is that the generic type formal parameter T doesn't convey
 enough information for the annotation-based code to reconstruct the correct
 result type. Try creating a type that embeds the actual value of the type
 parameter, e.g., SiteDaoArrayList extends ArrayListSiteDAO (or
 SiteDaoArrayList contains ListSiteDAO), and using that type as the return
 type of the @Get-annotated method.

 --tim


 On Tue, Jan 7, 2014 at 7:28 AM, Jon Finanger j...@finanger.no wrote:

 I was able to convert the LinkedHashMap values to ArrayListT using the
 ObjectMapper in my clientcode:
 ObjectMapper mapper =
 jacksonConverter.getObjectMapper();
 ArrayListSiteDAO sites =
 mapper.convertValue(tmp, new TypeReferenceArrayListSiteDAO() {});

 But getting this with a simple annotation i'm not able to figure out yet.

 --

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




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

Re: Tomcat deployment

2013-12-17 Thread Thierry Boileau
Hello Steven,

My first thought is that the war is missing the org.restlet.ext.jackson
extension (in the WEB-INF/lib subdirectory), and perhaps its
dependencies.
I've made a test using the internal eclipse servlet container, and it works
for me.


Best regards,
Thierry Boileau


2013/12/17 Steven Parks parxeconsult...@gmail.com

 Hopefully a simple error.
 I have a simple prototype Restlet application which I am using to put
 together the process.
 When run using the local test-cradle on port 8182 the application works
 fine.  When a WAR is created and deployed to Tomcat I receive:

 17-Dec-2013 08:44:10.059 WARNING [http-apr-8080-exec-7]
 org.restlet.service.Conv
 erterService.toRepresentation Unable to find a converter for this object :
 com.e
 ricsson.skillinventory.Resource@287cf889

 The object is serialized (for completeness), but at this time I am not
 attempting to return this from the resource, I am returning a simple String
 object.

 Do I need to register a Jackson converter even though it is not returned?

 My resource code is as simple as:
 @Get
 public String getResource() {

 Engine.setLogLevel(Level.FINE);

 Form queryParams = getQuery();
 String resourceId =
 queryParams.getFirstValue(resourceId);
 System.out.println(Resource is  + resourceId);

 Resource resource = new Resource();
 resource.setResourceName(John Smith);

 return howdy folks ( + resourceId + );
 }

 Thanks in advance

 --

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


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

Re: Nested object de-serialization in JsonRepresentation not working

2013-12-16 Thread Thierry Boileau
Hello Ramesh,

1) You must remove this instruction before calling getObject() :
System.out.println(jsonRepresentation.getText()); // HERE IS THE CULPRIT

The incoming representation is an instance of InputRepresentation. It's a
kind of representation that reads its content directly from the network
socket.
The problem is that you cannot read a socket twice, thus this
representation must be consumed (by getting the object, or printing its
content) only once.

If you want to reuse the content, make it persistent by, for example
storing the representation in memory (cf StringRepresentation), or storing
it on the file system (cf FileRepresentation).

Your next question is: why the framework generates by default this kind of
non-persistent representation?
We cannot assume to use persistent representations:
 - storing content in memory exposes you to potentially dramatic problem:
for example a request may post an infinite representation which would
injure your JVM.
 - storing content on file system is not a solution that the framework can
impose by default

2)
Is ForeignCollection an interface or abstract class? (
http://stackoverflow.com/questions/15100744/exception-while-using-jackson-and-ormlite-annotations-together-in-one-object
).

Best regards,
Thierry Boileau



2013/12/12 Ramesh ramesh_ragha...@yahoo.com

 I have an Order class and OrderDetail model as described below.

 class Order {
long id;
String description;
CollectionOrderDetail details;

public CollectionOrderDetail getDetails() {
  return details;
}
    other methods
 }

 class OrderDetail {
 long id;
 String productId;
 String qty;

... methods here...
 }

 And I have a JSON string of one Order with nested collection of
 OrderDetail. And I am trying to de-serialize this json string into Order
 object and expecting that the Order object will now contain the OrderDetail
 collection also as expected. But it is not working as expected.

 Here is the code snippet I have:

 JacksonRepresentationOrder jsonRepresentation = new
 JacksonRepresentationOrder(representation, Order.class);
 System.out.println(jsonRepresentation.getText()); // HERE IS THE CULPRIT
 Order order = jsonRepresentation.getObject();
 CollectionOrderDetail details = order.getDetails();

 1) When I do jsonRepresentation.getObject(), it is throwing an exception.

  (java.io.EOFException) java.io.EOFException: No content to map to Object
 due to end of input

 Why is that jsonRepresentation.getText(), causing the subsequent getObject
 to fail?

 2) I have an extended Collection class called ForeignCollection, which is
 simply a subclass of Collection. In order to use ForeignCollection instead
 of Collection, what do I have to do in Restlet? I am getting the following
 error when I change Collection to ForeignCollection in the above two
 classes - Order and OrderDetail:

  (org.codehaus.jackson.map.JsonMappingException)
 org.codehaus.jackson.map.JsonMappingException: Can not find a deserializer
 for non-concrete Collection type [collection type; ForeignCollection,
 contains [simple type, class Order]

 I am using Restlet 2.1.2.

 --

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


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

Re: odd problem with form posts

2013-12-16 Thread Thierry Boileau
Hello Sean,

what comes to my mind first is an issue where the input stream is consumed
before it goes to the testPost method.
Is there some filters (servlet or not) that read the input stream or
consume the request's representation (for example by printing it?)

You can try to debug by providing your own subclass of ServerServlet, and
update your web.xml file
servlet
  servlet-nameMyServlet/servlet-name
  servlet-classpath.to.MyServerServlet/servlet-class
  init-param
   param-nameorg.restlet.application/param-name
   param-valuepath.to.MyApplication/param-value
  /init-param
 /servlet

 servlet-mapping
  servlet-nameMyServlet/servlet-name
  url-pattern/*/url-pattern
 /servlet-mapping

and see what happen in the service(HttpServletRequest,
HttpServletResponse) method, especially regarding the
request.getInputStream().

Best regards,
Thierry Boileau
ps : for a customer we use Restlet 2.1.4 with Tomcat, and it works without
problems.


Best regards
Thierry Boilean



2013/12/11 Sean Hogan s...@clixtec.ca

 I have been having a problem for a while, that comes and goes. Recently
 it came back and won't go.  :-(  This is Restlet 2.1.4, Java EE edition.

 Sometimes when a client posts a non-empty form with
 application/x-www-form-urlencoded, the form arrives empty at the @Post
 method.  As you might be able to appreciate, this has been very
 difficult to debug due to the lazy evaluation techniques employed in
 Restlet.

 Unfortunately the Restlet application is large, and part of a huge
 servlet-based web app.   I have not been able to boil this problem down
 to just the essentials that show the problem.  Here is something similar
 to the server code:

 import org.restlet.Server;
 import org.restlet.data.Form;
 import org.restlet.data.Protocol;
 import org.restlet.resource.Post;
 import org.restlet.resource.ServerResource;

 public class FormProblem extends ServerResource {
  @Post
  public String testPost(Form form) {
  return form.toString();
  }

  public static void main(String[] args) throws Exception {
  new Server(Protocol.HTTP, 8182, FormProblem.class).start();
  }
 }

 As I said, this problem does not always happen.  For a time it happened
 only on the first post and all subsequent ones were okay until the app
 was restarted.  But now it is happening to me consistently (but again,
 not in that tiny sample).

 Has anyone seen this sort of behaviour?  Can any Restlet developer
 suggest a strategy that will allow me to debug this?  What is the
 earliest point in Restlet where I will be able to see the request body
 in a debugger?

 Thanks very much,
 Sean

 --

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


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

Re: Scoring of entity variants

2013-12-16 Thread Thierry Boileau
Hello Arjohn,

I guess this is related to this issue
https://github.com/restlet/restlet-framework-java/issues/807 even if the
symptoms are different.
I guess that the method post(Object) behaves much more as you expect.

For me you are pointing an issue.

Best regards,
Thierry Boileau




2013/11/12 Arjohn Kampman arjohn.kamp...@vound-software.com

 Hi all,

 We're running into an issues regarding the scoring of entity variants on
 the client. We found out that ClientResource.handle(Method method,
 Object entity, ClassT resultClass) scores the variants for POST
 entities by the accepted media type for the result entity. Why is that?

 In our case the POST entity matches with a custom media type as well as
 JSON. The requested result type (String[]) matches with another custom
 media type and JSON as well. ClientResource chooses the JSON format over
 our custom format here because that format is also one of the accepted
 media types for the result. This looks like an odd choice me. I would
 expect the code just to look at the scores of the variants and pick the
 one with the highest score, or the first one of those if there are
 multiple.

 Some insight in the reasoning behind this would be welcome.

 Cheers,
 Arjohn Kampman

 --

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


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

Re: odd problem with form posts

2013-12-16 Thread Thierry Boileau
Hello Sean,

that sounds great!
Effectively, getting parameters consumes the request's body, as explains
here
http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getParameter%28java.lang.String%29
:
If the parameter data was sent in the request body, such as occurs with an
HTTP POST request, then reading the body directly via
getInputStream()http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getInputStream%28%29or
getReader()http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getReader%28%29can
interfere with the execution of this method.

Best regards,
Thierry Boileau




2013/12/16 Sean Hogan s...@clixtec.ca

  Thanks for the hint Thierry.  I found a place where one of the 11 (!)
 filters in our app was unconditionally calling getParameter on the
 ServletRequest.  It appears this causes the request body to be consumed, at
 least when the Content-Type is x-www-form-urlencoded.  I changed it to
 avoid calling getParameter on non-GET requests and things are now working.

 Thanks again,
 Sean


 On 13-12-16 09:45 AM, Thierry Boileau wrote:

  Hello Sean,

 what comes to my mind first is an issue where the input stream is consumed
 before it goes to the testPost method.
  Is there some filters (servlet or not) that read the input stream or
 consume the request's representation (for example by printing it?)

  You can try to debug by providing your own subclass of ServerServlet,
 and update your web.xml file
 servlet
   servlet-nameMyServlet/servlet-name
   servlet-classpath.to.MyServerServlet/servlet-class
   init-param
param-nameorg.restlet.application/param-name
param-valuepath.to.MyApplication/param-value
   /init-param
  /servlet

  servlet-mapping
   servlet-nameMyServlet/servlet-name
   url-pattern/*/url-pattern
  /servlet-mapping

  and see what happen in the service(HttpServletRequest,
 HttpServletResponse) method, especially regarding the
 request.getInputStream().

 Best regards,
 Thierry Boileau
  ps : for a customer we use Restlet 2.1.4 with Tomcat, and it works
 without problems.


  Best regards
 Thierry Boilean



 2013/12/11 Sean Hogan s...@clixtec.ca

 I have been having a problem for a while, that comes and goes. Recently
 it came back and won't go.  :-(  This is Restlet 2.1.4, Java EE edition.

 Sometimes when a client posts a non-empty form with
 application/x-www-form-urlencoded, the form arrives empty at the @Post
 method.  As you might be able to appreciate, this has been very
 difficult to debug due to the lazy evaluation techniques employed in
 Restlet.

 Unfortunately the Restlet application is large, and part of a huge
 servlet-based web app.   I have not been able to boil this problem down
 to just the essentials that show the problem.  Here is something similar
 to the server code:

 import org.restlet.Server;
 import org.restlet.data.Form;
 import org.restlet.data.Protocol;
 import org.restlet.resource.Post;
 import org.restlet.resource.ServerResource;

 public class FormProblem extends ServerResource {
  @Post
  public String testPost(Form form) {
  return form.toString();
  }

  public static void main(String[] args) throws Exception {
  new Server(Protocol.HTTP, 8182, FormProblem.class).start();
  }
 }

 As I said, this problem does not always happen.  For a time it happened
 only on the first post and all subsequent ones were okay until the app
 was restarted.  But now it is happening to me consistently (but again,
 not in that tiny sample).

 Has anyone seen this sort of behaviour?  Can any Restlet developer
 suggest a strategy that will allow me to debug this?  What is the
 earliest point in Restlet where I will be able to see the request body
 in a debugger?

 Thanks very much,
 Sean

 --

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





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

Re: Routing woes...

2013-12-09 Thread Thierry Boileau
Hello,

perhaps you don't need the ServerResource class, and can directly define
your own Restlet subclass:

@Override
public Restlet createInboundRoot() {
Restlet restlet = new Restlet(getContext()) {
@Override
public void handle(Request request, Response response) {
// TODO Auto-generated method stub
super.handle(request, response);
}
};
return restlet;
}

Best regards,
Thierry Boileau



2013/12/9 Arjohn Kampman arjohn.kamp...@vound-software.com

 Perhaps attachDefault(...) does what you're looking for? Or maybe you
 don't need the router at all and attach the Finder to whatever you are
 attaching the Router to?


 On 08/12/2013 16:46, Niclas Hedhman wrote:
 
  Hi, (not sure if this is still the proper mailing list)
 
  I have in a new project the need to let a Finder provide the
  ServerResource subclass for ALL URI paths, instead of individual
 matching.
 
  I want to do something like;
 
  Finder finder = createRestletFinder(
  EntityListServerResource.class, getContext() );
  router.attach( /*, finder );
  return router;
 

 --

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


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

Re: Manually setting the base URL in Restlet

2013-12-09 Thread Thierry Boileau
Hello Hannes,


did you try to set the request's resourceRef, for example by using a filter?
For example, the client hits http://localhost:8182/test?querypart;, but
the application is routed on http://localhost:8182/app/test;
The filter leverages the remaining part of the request's reference, which
is updated by each router that the request meets before hitting the target
resource.

@Override
public Restlet createInboundRoot() {
final Router router = new Router(getContext());
router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
router.attach(/app/test, TestResource.class);

Filter filter = new Filter(getContext(), router) {
@Override
protected int beforeHandle(Request request, Response response) {
Reference ref = request.getResourceRef();
ref.setIdentifier(http://localhost/app; +
ref.getRemainingPart());
ref.setBaseRef(http://localhost;);
return super.beforeHandle(request, response);
}
   };
   return filter;
}


I'm not sure it solves exactly your problem, but it can gives you some
ideas.

Best regards,
Thierry Boileau





2013/12/6 Hannes Ebner hannes.eb...@gmail.com

 Hi,

 I have a Restlet application running in Tomcat, proxied through Apache.
 Only Apache can be reached from the outside.

 Internally I'm using the OpenID extension to perform authentication, which
 causes problems in the given reverse proxy setting. The OpenID extension
 asks Restlet for the base URL to set the realm, and Restlet of course only
 knows its URL via Tomcat, which in turn does not know that it is being
 proxied.
 This means that the application is reached from the outside via
 https://base/app, but Restlet and OpenID think that it is
 http://base:8080/something which does not work with all the necessary
 redirects in the OpenID flow.

 I tried really hard to find a way of telling Restlet (and the OpenID
 extension) to use a base URL that is different from the one that Tomcat
 reports, but still, I ended up asking for help on this list.

 Can the base URL be manually set somehow?

 Best regards,
 Hannes


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

Re: restlet TunnelFilter incorrectly removing + from query params

2013-12-05 Thread Thierry Boileau
Hi Rob,

To my mind, there is a problem in the current implementation.
Before the tunnel checks the query, it decodes it using the UTF-8 character
set by default.
In case the tunnel has detected and filtered a query parameter, it computes
a new query by removing the filtered query parameter. This new query is
then encoded before being set to the request but without any character set.
I wonder why no encoding has been defined.

Best regards,
Thierry


2013/12/5 Thierry Boileau tboil...@restlet.com

 Hello Rob,

 I have time today to check what happens.

 Best regards,
 Thierry Boileau


 2013/12/2 Rob Elsner r...@wowza.com

 I opened this issue;
 https://github.com/restlet/restlet-framework-java/issues/804

 but I haven't heard anything back.

 I'm curious if anyone has an opinion on restlet and how the TUnnelFilter
 is re-encoding a + symbol.  I think in this case the parameters are already
 decoded, so any + should have come from a %2b and should be re-encoded as a
 %2b, not a space (%20).  This only happens when ?media= is used in the
 query parameters, if this is left out then the %2b is forwarded correctly
 to my controller.

 Thanks in advance,
 Rob

 --

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




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

Re: Cookie domain not set

2013-12-05 Thread Thierry Boileau
Hello,

I've made some tests and notice that the browser (at least Firefox and
chromium) doesn't send the domain data in the cookie header. Thus the value
is not set at the cookie level.
If you really need the domain, you can infer it from the request's
reference:
request.getResourceRef().getHostDomain()

By doing do, you will get the full name of the request's domain.

If you still need to read the domain from the cookie inside the code of
your resources, you can also add a filter in front of your resources that
completes the current cookies, and add the domain parameter taken from the
request's reference.

Best regards,
Thierry Boileau

ps :
// First server response, that requires the browser to record a cookie.
HTTP/1.1 200 OK
Content-Length: 12
Content-Type: text/plain; charset=UTF-8
Date: Thu, 05 Dec 2013 09:02:04 GMT
Accept-Ranges: bytes
Server: Restlet-Framework/@major-number@.@minor-number@@release-type@
@release-number@
Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
Set-Cookie: test=myvalue; Domain=.tboi.net

hello, world

// Second client request, note the cookie header, without domain data.
GET /hello HTTP/1.1
Host: yop.tboi.net:
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:25.0) Gecko/20100101
Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: test=myvalue
Connection: keep-alive
Cache-Control: max-age=0



2013/11/22 Mathieu Gond mamath...@hotmail.com

 Hello Everybody,

 We are trying to read Cookies (getRequest().getCookies()) in a
 ServerResource and We can't get the domain (getDomaine()) because it is not
 set.

 Is there a reason that it is not set or is it a bug (We are using restlet
 JavaSE 2.0.5)

 Thanks in advance

 Mathieu and Thierry

 --

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


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

Re: GWT Restlet cross domain Put request

2013-12-05 Thread Thierry Boileau
Hello,

I can not get these methods to work using Restlet GWT, are these methods
supported.
yes, these methods are supported.
I've never tested such method in a cross-domain context.

Best eregards,
Thierry Boileau


2013/11/18 Larry larry.edward...@roames.com.au

 Hi there

 I have read extensively about (SOP) Same Origin Policy and the issues in
 the Browser.
 I can successfully execute cross domain gets by setting the headers in the
 server to allow the request (Access-Control-Allow-Origin, *).

 The question is, are there different headers to allow post and put?
 I can not get these methods to work using Restlet GWT, are these methods
 supported.

 If so, can someone point me to an  example of GWT calling cross domain
 put/post, I have searched for example with no luck.

 --

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


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

Re: restlet TunnelFilter incorrectly removing + from query params

2013-12-04 Thread Thierry Boileau
Hello Rob,

I have time today to check what happens.

Best regards,
Thierry Boileau


2013/12/2 Rob Elsner r...@wowza.com

 I opened this issue;
 https://github.com/restlet/restlet-framework-java/issues/804

 but I haven't heard anything back.

 I'm curious if anyone has an opinion on restlet and how the TUnnelFilter
 is re-encoding a + symbol.  I think in this case the parameters are already
 decoded, so any + should have come from a %2b and should be re-encoded as a
 %2b, not a space (%20).  This only happens when ?media= is used in the
 query parameters, if this is left out then the %2b is forwarded correctly
 to my controller.

 Thanks in advance,
 Rob

 --

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


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

RE: ZipException with Restet 2.1 RC6

2013-11-15 Thread Thierry Boileau
Hi Tal,
I've added the ability to override the accept-encoding header. It is based on 
the tunnel service (turn the userAgentTunnel proprty to true). By default, it 
will replace the accept-encoding header value for msie, only if its curent 
value is deflate, have a look at the 
modules/org.restlet/src/org/restlet/service/accept-encoding.properties.
I think you will understand it quickly. If not, please tell me. By the way, you 
can also tell me what could the default value for the msie browser.
Cheers.
Thierry Boileau

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


Re: GWT with Restlet JSE examples

2013-11-15 Thread Thierry Boileau
Hello Guillaume,

I've seen the missing file, I try to recover it (
https://github.com/restlet/restlet-framework-java/issues/796).

Just a few words about GWT. There are two modes. The first is the
development mode, then the runtime mode.

In runtime mode, you get simple static files (html bootstraps files, and
gwt javascript code, images, css, etc) generated by GWT compilation, and a
REST api based on the Restlet framework. Statics files and API can both be
handled by the JSE edition of Restlet (or a servlet container).
In development mode, you have a GWT project that aims at developing the
client application, using the GWT edition of Restlet. This edition is a
port of the client API of Restlet for GWT (of course, there is no server
available in the browser). The GWT edition is composed of the port of the
core module which is sufficient, and facultative extensions (for json, and
xml handling).
On the server side, there is a restlet-based application, using either the
jse or jee, or gae edition.
The jse, jee, gae editions are shipped with a GWT extension: this extension
gives the ability to Restlet-based APIs to communicate with a GWT-based
client, using the GWT serialization/deserialization format. By doing so,
your API can communicate with a GWT client application, or any other kind
of client, at the time with the same resources.


Best regards,
Thierry Boileau


2013/11/14 Guillaume Pelletier tig...@perlhive.com

 Hi everyone, I've been investigating the restlet framework for several
 service based projects which I may inherit and I've been looking for
 examples of deployment outside of any Servlet Container.

 I ended up here: http://restlet.org/learn/guide/2.1/editions/gwt/examplesbut 
 the download link leads to nothing.

 I'm wondering if it's doable. I currently have a little Guice + Restlet
 integration which works well enough. Everything is built through Guice
 modules and I start restlet with a Component class in a runner using the
 jetty connector. (attached)

 If I wanted to do similar for a GWT deployment of a setup application (as
 proof of concept), could I use the same approach or would I need to modify
 how everything is bootstrapped?

 --

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

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

Re: bug with SpringFinder?

2013-11-15 Thread Thierry Boileau
Hi Sean,

thanks for submitting this question: I've entered  an issue for that point:
https://github.com/restlet/restlet-framework-java/issues/797

best regards,
Thierry Boileau


2013/11/15 Sean Hogan s...@clixtec.ca

  Hi,

 I believe I may have found a bug with the way SpringFinder works in
 Restlet 2.1.4.

 I have two Application subclasses, each with one Router.  Call them app1
 and app2, mapped in my servlet-based web app to /app1 and /app2.  Both
 apps define a template /metadata mapped to their own private Resource
 subclasses (Metadata1Resource and Metadata2Resource).  app2 happens to be
 initialized after app1.

 I find that invoking /app*1*/metadata instantiates a Metadata*2*Resource.
 Looking into how this happens, I believe the problem is that SpringFinder
 is a singleton, and therefore gets attached to both Routers in order of
 initialization.  Since app2 was initialized later, it wins, and the
 /metadata is looked up relative to that Router.

 The bit of Spring context for app1 looks like this:

 bean id=router1 class=org.restlet.ext.spring.SpringRouter
 property name=attachments
 map
 entry key=/metadata!-- GET --
  bean class=org.restlet.ext.spring.SpringFinder
  lookup-method name=create
 bean=metadataResource /
  /bean
  /entry
 ...
 /bean

 bean id=metadataResource class=...Metadata1Resource
 scope=prototype /

 and similarly for app2.  Both apps are loaded into the same Spring context.

 If I'm understanding things correctly, this is a fundamental issue in
 using SpringFinder with multiple Routers.  Can anyone give me workaround?
 I absolutely need my Resource instances to be created by Spring so they get
 autowired.

 Thanks,
 Sean


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

Re: bug with SpringFinder?

2013-11-15 Thread Thierry Boileau
ok, thanks Sean.
I close the issue.

Best regards,
Thierry Boileau


2013/11/15 Sean Hogan s...@clixtec.ca

  Never mind.  Like an idiot I had two beans named metadataResource.  I
 thought Spring would whine about that, but apparently not.  :-(

 (There may still be an issue with SpringFinder, but not from my flawed
 analysis.)

 Thanks,
 Sean


 On 13-11-15 01:31 PM, Sean Hogan wrote:

 Hi,

 I believe I may have found a bug with the way SpringFinder works in
 Restlet 2.1.4.

 I have two Application subclasses, each with one Router.  Call them app1
 and app2, mapped in my servlet-based web app to /app1 and /app2.  Both
 apps define a template /metadata mapped to their own private Resource
 subclasses (Metadata1Resource and Metadata2Resource).  app2 happens to be
 initialized after app1.

 I find that invoking /app*1*/metadata instantiates a Metadata*2*Resource.
 Looking into how this happens, I believe the problem is that SpringFinder
 is a singleton, and therefore gets attached to both Routers in order of
 initialization.  Since app2 was initialized later, it wins, and the
 /metadata is looked up relative to that Router.

 The bit of Spring context for app1 looks like this:

 bean id=router1 class=org.restlet.ext.spring.SpringRouter
 property name=attachments
 map
 entry key=/metadata!-- GET --
  bean class=org.restlet.ext.spring.SpringFinder
  lookup-method name=create
 bean=metadataResource /
  /bean
  /entry
 ...
 /bean

 bean id=metadataResource class=...Metadata1Resource
 scope=prototype /

 and similarly for app2.  Both apps are loaded into the same Spring context.

 If I'm understanding things correctly, this is a fundamental issue in
 using SpringFinder with multiple Routers.  Can anyone give me workaround?
 I absolutely need my Resource instances to be created by Spring so they get
 autowired.

 Thanks,
 Sean




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

Re: how to set javax.net.ssl.SSLContext to Restlet ClientResource

2013-08-14 Thread Thierry Boileau
Hello Emre,

the way to configure the client helper, is to provide a ssl context factory
instead of a ssl context.
You can provide your own factory or use one provided by the framework:
 - org.restlet.ext.ssl.DefaultSslContextFactory
 - org.restlet.ext.ssl.PkixSslContextFactory
 - org.restlet.ext.ssl.JsslutilsSslContextFactory

The first one should fit your needs, it can be parametrized as follow
http://restlet.org/learn/javadocs/2.1/jse/ext/org/restlet/ext/ssl/DefaultSslContextFactory.html
.

Best regards,
Thierry Boileau




2013/8/14 emre he emre...@gmail.com

 Hi,

 i am using Restlet client ClientResource to act as a REST Client, i will
 use
 HTTPS connection and trying to set SslContext to ClientResource, is there
 any way to set javax.net.ssl.SSLContext to ClientResouce?

 below codes will generate exception which caused ClientResource start
 failed.

 SSLContext sslContext = null;
 sslContext = SSLContext.getInstance(tls);
 sslContext.init(..., ..., ...);
 clientResource.getContext().getAttributes().put(sslContextFactory,
 sslContext);

 errors:
 WARNING: Unable to start the Restlet
 java.lang.ClassCastException: javax.net.ssl.SSLContext cannot be cast to
 org.restlet.ext.ssl.SslContextFactory
 at

 org.restlet.ext.ssl.internal.SslUtils.getSslContextFactory(SslUtils.java:135)
 at
 org.restlet.ext.ssl.HttpsClientHelper.start(HttpsClientHelper.java:146)
 at org.restlet.Client.start(Client.java:217)
 at org.restlet.Restlet.handle(Restlet.java:315)
 at org.restlet.Client.handle(Client.java:177)
 at org.restlet.routing.Filter.doHandle(Filter.java:159)
 at org.restlet.routing.Filter.handle(Filter.java:206)
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:1136)
 at

 org.restlet.resource.ClientResource.handleOutbound(ClientResource.java:1225)
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:1068)
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:1044)
 at
 org.restlet.resource.ClientResource.post(ClientResource.java:1453)


 thanks,
 Emre



 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/how-to-set-javax-net-ssl-SSLContext-to-Restlet-ClientResource-tp7578897.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

Re: Restlet runing with Jetty on HTTPS BindException

2013-08-14 Thread Thierry Boileau
Hello Patrick,

I've add an answer to your question on SOF.

Best regards,
Thierry Boileau


2013/8/12 Patrick Dürsteler patr...@sunsus.net

 Hello

 I have BindExceptions if I'm trying to run Restelt with Jetty:


 http://stackoverflow.com/questions/18053034/restlet-runing-with-jetty-on-https-bindexception

 regards

 Patrick

 --

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


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

Re: Re: Restlet Framework 2.1.2 and 2.2 M3 released (+ new web site)

2013-04-18 Thread Thierry Boileau
Hello Darryl, Arjohn,

I've reconnected the nexus indexation process... It should be better now.
Thanks for reporting this issue.

Best regards,
Thierry Boileau


2013/4/17 Darryl Miles dar...@netbauds.net

 Doh!

 http://maven.restlet.org/.index/nexus-maven-repository-index.properties

 has:

 #Tue Nov 22 17:06:04 CET 2011
 nexus.index.chain-id=1321977964270
 nexus.index.id=restlet-ctx
 nexus.index.timestamp=2022160603.707 +
 nexus.index.last-incremental=0

 Please annihilate the /.index/ folder and have someone who understands
 Maven and repos review completely your setup.

 I suspect some inexperienced admin simply did a file copy (in the past)
 and I suspect you are not currently using nexus at all.

 --

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


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

RE: Re: Restlet Framework 2.1.2 and 2.2 M3 released (+ new web site)

2013-04-17 Thread Thierry Boileau
Hello Darryl, Arjohn,

I've reconnected the nexus indexation process... It should be better now.
Thanks for reporting this issue.

Best regards,
Thierry Boileau

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


Re: empty form on POST? (not GAE)

2013-04-11 Thread Thierry Boileau
Hello Sean,

could you precise the version of Restlet are you using?

Best regards,
Thierry Boileau


2013/4/10 Sean Hogan seanmho...@hotmail.com

 Hello all,

 My experience with Restlet to date has generally been pleasant; thanks for
 that.

 I've been having a problem in some near-production code whereby the first
 POST received by a restlet after the app starts up gets an empty form.  The
 second POST is fine.  This is with the Servlet extension, running under
 Tomcat.  It also happens in GWT hosted mode (embedded Jetty).

 I've traced it into DefaultConverter.toObject where it creates a new Form
 from the source, and gets an immediate EOF on the entity's input stream.
  The Content-Type and Content-Length of the request are set properly and
 the correct content in application/x-www-form-urlencoded format is
 definitely present.

 Unfortunately I can't share the exact code but I've created and attached a
 small, very similar sample that seems to show a similar problem.  (Not
 exactly the same in that the POSTed data never appears at all.)

 Could someone explain why the posted form in the attached sample is always
 empty?  Again this is in a servlet environment.

 Thanks very much,
 Sean
 ---
 Sean Hogan
 sean at compusult dot net

 --

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

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

RE: Setting Response Header with JAX-RS

2013-03-14 Thread Thierry Boileau
Hello,

an issue has been entered #739 
(https://github.com/restlet/restlet-framework-java/issues/739) by Mark 
Kharitonov.

Best regards,
Thierry Boileau

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


Re: Re: Re: Re: Re: Location-ref not set in IE9

2013-03-08 Thread Thierry Boileau
Hi Koen,

I've also redeployed 2.1 snapshot artefacts (
http://restlet.org/download/2.1/restlet-gwt-2.1snapshot.zip, or
http://maven.restlet.org/org/restlet/gwt/org.restlet/2.1-SNAPSHOT/).

Anyhow, there is nothing that can be done about the missing response
headers. Total clusterf#ck by MS.
true...

Best regards,
Thierry Boileau


2013/3/7 Koen Maes k...@koma.be

 Thx Thiery...

 I read everywhere it should be fixed in IE10 but the recent port of IE10
 to Win7, I see the same behaviour.

 Anyhow, there is nothing that can be done about the missing response
 headers. Total clusterf#ck by MS.

 --

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


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

Re: Re: Re: Re: Location-ref not set in IE9

2013-03-07 Thread Thierry Boileau
Hi,

I've updated the current snapshot. It considers that status code 1223 is
equivalent to status 204.
Thanks a lot for your investigations.

Best regards,
Thierry Boileau


2013/3/2 Fabian Mandelbaum fmandelb...@gmail.com

 If it helps, I only use HTTP 204 response code for successful DELETE
 requests. For a POST I think HTTP 201 or 202 is more appropriate... but
 that's just the purist in me ;-)

 Cheers.


 On Thu, Feb 28, 2013 at 7:02 AM, Koen Maes k...@koma.be wrote:

 So it is a known issue in IE8/IE9 and supposedly fixed in IE10. IE turns
 status response 204 in 1223 and eats all the response headers !
 All major javascript frameworks have a workaround for this. But you can't
 restore the headers of course if the IE never passes them from the
 XMLHttpRequest.
 I will modify my code and return 200 where I used to return 204. That
 should work.

 --

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




 --
 Fabián Mandelbaum
 IS Engineer


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

Re: @Post not handling multiple variants properly?

2013-02-26 Thread Thierry Boileau
Hello Jon,

thanks for reporting this issue. I've entred a new ticket for this :
https://github.com/restlet/restlet-framework-java/issues/733

Best regards,
Thierry Boileau


2013/2/16 Jon Sawyer j...@jsawyer.net

 I have a Restlet ServerResource method annotated with @Post(multipart).
 It works fine that way. I change only the annotation to
 @Post(multipart|xml), and now I get Unsupported Media Type - The server
 is refusing to service the request because the entity of the request is in
 a format not supported by the requested resource for the requested method.
 Why would *adding* a handled mediatype stop the previously working
 mediatype from working?

 I have also tried @Post(multipart:html|xml), because HTML is what the
 client is requesting, but this fails with the same error.

 I do have a converter for multipart form data in effect, and that is the
 type of data I'm submitting via POST.

 I turned up global logging to FINEST to try understand how Restlet
 searches for the handler for a particular meditype, but apparently that
 code isn't instrumented with logging. That in itself I would consider a
 minor bug.

 This is Restlet 2.1.1, GAE edition.

 --

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


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

Re: Maven artifacts disappearing

2013-02-15 Thread Thierry Boileau
hello Peter,

I've restored the missing artifacts.

Best regards,
Thierry Boileau


2013/2/11 Peter Major peter.ma...@forgerock.com

 Hi,

 I can see 2.1-RC6, but 2.1-RC4 is missing. :( Do you have any scripts you
 can share to (re)deploy the artifacts?

 Thanks,
 Peter

 --

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


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

Re: Maven artifacts disappearing

2013-02-13 Thread Thierry Boileau
Hi all,

I've restored 2.1RC4 (except gae edition). I plan to end the restauration
this week.

Best regards,
Thierry Boileau


2013/2/11 Jerome Louvel jlou...@restlet.com

 Hi Peter,

 Indeed, we have not restored all versions yet. Here are the list of
 missing ones:

- 2.1 RC2 - RC5
- 2.0 M1 - M3
- 2.0.11

 We are planning to restore all of them but had others priorities so far.

 If you need to build those artifacts manually, you can find all the tags
 here:
 https://github.com/restlet/restlet-framework-java/tags

 Have a look at this page to get started:
 https://github.com/restlet/restlet-framework-java/wiki/Building-the-source

 Feel free to post additional questions.

 Thanks,
 Jerome
 --
 http://restlet.com
 http://twitter.com/#!/jlouvel





 2013/2/11 Peter Major peter.ma...@forgerock.com

 Hi,

 I can see 2.1-RC6, but 2.1-RC4 is missing. :( Do you have any scripts you
 can share to (re)deploy the artifacts?

 Thanks,
 Peter

 --

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




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

RE: Maven version range not working post restore

2013-01-25 Thread Thierry Boileau
Hello,

Thanks for reporting this, the metadata has been updated.

Best regards,
Thierry Boileau

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


Re: Serving static files using Directory and CLAP from a jar

2013-01-11 Thread Thierry Boileau
Hi Robert,

I send you a zip file of the eclipse project (testRobert.zip), and the jar
file generated by eclipse.
I launch the application on command line as follow:
java -cp testRobert.jar:/home/thierry/restlet/branches/2.1/org.restlet.jar
test.MyApplication


Best regards,
Thierry Boileau


2013/1/11 Robert Brewer rbre...@lava.net

 Hmm, I could not clap and jars for a directory to work. Do you have
 the test code that worked available? I will try reducing my code to a
 bare minimum to see what is going on, but another project has come up
 so I have to investigate later.

 Thanks for your help.

 On Wed, Jan 9, 2013 at 10:36 PM, Thierry Boileau tboil...@restlet.com
 wrote:
  Hi Robert,
 
  I've just tried the clap connector using a jar file and it works for me
 (I
  mean such url works : http://localhost:8182/stat/index.html;,
  http://localhost:8182/stat/;). Just take care to complete properly the
  classpath when lauching your application from the command line.
 
  Best regards,
  Thierry Boileau
 
 
  2013/1/10 Thierry Boileau tboil...@restlet.com
 
  Hello Robert,
 
  from what I notice, the resolution of a file is more or less based on
  the ability to discover ressources having the same base name. A file
  directory is perfect because it is possible to list all ressources
 within
  the same parent directory.
  A classloader is more retrictive and gives access to a single
 resource...
  which explains the behaviour of the indexName attribute of a
 Directory.
  I check why it does not work from a jar file.
 
  You can also connect the Directory with the jar file using the JAR
  protocol or the ZIP protocol. Such protocol is based on the JDK ZipEntry
  class which has the ability to list files (such as a directory).
  directory = new Directory(getContext(), zip: +
  LocalReference.createFileReference(new File(/your/path)) + !/ );
  Of course, it obliges you to reference the jarfile from itself. You can
  consider this as a workaround.
 
  Best regards,
  Thierry Boileau
 
 
  2013/1/10 Robert Brewer rbre...@lava.net
 
  Hello Restlet folks. I have a problem serving static files using
  Restlet's Directory class and the CLAP pseudo protocol (apparently a
  popular topic right now :)
 
  I have a standalone web application that uses Restlet to provide a
  RESTful API. Some students taking a class have written a nice client
  for the web application as a Single Page Application (SPA) consisting
  of HTML5/CSS/Javascript. I would like to store a directory containing
  the static SPA files in my web application's jar file and to serve
  them under a specific URI so the SPA client and server are
  self-contained
 
  The way I am trying to do this is:
 
public synchronized Restlet createInboundRoot() {
  ...
  Directory directory = new Directory(getContext(),
  clap://class/spa/);
  router.attach(/spa/, directory);
  ...
 
  Unfortunately, this doesn't work. When I run the server from my jar
  file and point a browser at /spa/, the browser downloads an empty
  file (Chrome calls it download, Safari calls it spa) rather than
  rendering the page. Browsing to /spa/index.html does work, but I
  don't want users to have to remember to add the index.html.
 
  Am I doing something wrong here? It seems like this should work. I'm
  open to other ways to accomplish this goal.
 
  Annoyingly, the server behaves differently when running from Eclipse
  than when running from a jar file, which makes troubleshooting this
  problem more painful since I have to build the jar file to test
  fixes.For example, when running from Eclipse, /spa/ gives a 404
  error, instead of downloading an empty file.
 
  I also tried playing with setIndexName(). If I set it to index.html
  (including the extension despite the Javadoc saying the parameter
  should be without extension), then it works when run from Eclipse but
  not from the jar file.
 
  Thanks in advance for any suggestions on how to make this work!
 
  --
  Robert Brewer
  http://excitedcuriosity.wordpress.com/
  https://www.facebook.com/kukuicup
 
  --
 
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3042270

 --
 Robert Brewer
 http://excitedcuriosity.wordpress.com/
 https://www.facebook.com/kukuicup

 --

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


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

testRobert.jar
Description: application/java-archive


Re: Serving static files using Directory and CLAP from a jar

2013-01-10 Thread Thierry Boileau
Hello Robert,

from what I notice, the resolution of a file is more or less based on the
ability to discover ressources having the same base name. A file directory
is perfect because it is possible to list all ressources within the same
parent directory.
A classloader is more retrictive and gives access to a single resource...
which explains the behaviour of the indexName attribute of a Directory.
I check why it does not work from a jar file.

You can also connect the Directory with the jar file using the JAR protocol
or the ZIP protocol. Such protocol is based on the JDK ZipEntry class which
has the ability to list files (such as a directory).
directory = new Directory(getContext(), zip: +
LocalReference.createFileReference(new File(/your/path)) + !/ );
Of course, it obliges you to reference the jarfile from itself. You can
consider this as a workaround.

Best regards,
Thierry Boileau


2013/1/10 Robert Brewer rbre...@lava.net

 Hello Restlet folks. I have a problem serving static files using
 Restlet's Directory class and the CLAP pseudo protocol (apparently a
 popular topic right now :)

 I have a standalone web application that uses Restlet to provide a
 RESTful API. Some students taking a class have written a nice client
 for the web application as a Single Page Application (SPA) consisting
 of HTML5/CSS/Javascript. I would like to store a directory containing
 the static SPA files in my web application's jar file and to serve
 them under a specific URI so the SPA client and server are
 self-contained

 The way I am trying to do this is:

   public synchronized Restlet createInboundRoot() {
 ...
 Directory directory = new Directory(getContext(), clap://class/spa/);
 router.attach(/spa/, directory);
 ...

 Unfortunately, this doesn't work. When I run the server from my jar
 file and point a browser at /spa/, the browser downloads an empty
 file (Chrome calls it download, Safari calls it spa) rather than
 rendering the page. Browsing to /spa/index.html does work, but I
 don't want users to have to remember to add the index.html.

 Am I doing something wrong here? It seems like this should work. I'm
 open to other ways to accomplish this goal.

 Annoyingly, the server behaves differently when running from Eclipse
 than when running from a jar file, which makes troubleshooting this
 problem more painful since I have to build the jar file to test
 fixes.For example, when running from Eclipse, /spa/ gives a 404
 error, instead of downloading an empty file.

 I also tried playing with setIndexName(). If I set it to index.html
 (including the extension despite the Javadoc saying the parameter
 should be without extension), then it works when run from Eclipse but
 not from the jar file.

 Thanks in advance for any suggestions on how to make this work!

 --
 Robert Brewer
 http://excitedcuriosity.wordpress.com/
 https://www.facebook.com/kukuicup

 --

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


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

RE: Re: dependencies in 2.2-SNAPSHOT

2012-12-21 Thread Thierry Boileau
Hello Tim,

thanks for reporting these issues.

I've updated the libraries:
 - precised the stax2api version = 3.1.1
I've updated the servlet library
 - precised the available version of servlet api in maven central repository : 
3.0-alpha-1 ...

Best regards,
Thierry Boileau

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


RE: Re: another CookieAuthenticator mystery

2012-12-21 Thread Thierry Boileau
Hello Tim,

I'm sorry for the delay of my answer.
It clearly appears to me that the promised feature were not implemented, and 
therefore were lacking from the initial contribution.
Thanks a lot for reporting this issue, I've added your contribution, with a 
small adjustement : I test the loginFormPath value. When it is null, we 
cannot redirect, therefore it calls super#challenge(Response, boolean).

Best regards,
Thierry Boileau

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


RE: Re: another CookieAuthenticator mystery

2012-12-21 Thread Thierry Boileau
Hi tim,

I've applied it also on the 2.1 branch.


Best regards,
Thierry Boileau

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


RE: Re: another CookieAuthenticator mystery

2012-12-21 Thread Thierry Boileau
Hi Tim,

I've read your mail, and have a question about this :
an instance of my CookieAuthenticator extension around a
Restlet that does nothing. (If you leave out this vacuous Restlet, the
machinery complains about a Filter with no target.)

Clearly, a filter is meant to transmit the request/response to a next Restlet.
In this case, when a request is authenticated, I wonder what is the behaviour 
of the CookieAuthenticator.
This is the end of the year, I'm a little bit tired, so my question may be 
confuse. :)

Best regards,
Thierry Boileau

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


Re: Re: another CookieAuthenticator mystery

2012-12-21 Thread Thierry Boileau
Hi Tim,

yes, you're right, it reverts to the ChallengeAuthenticator behaviour. I
wonder if CookieAuthenticator is really a ChallengeAuthenticator.

Best regards,
Thierry Boileau


2012/12/21 Tim Peierls t...@peierls.net

 Sounds good, so if you haven't provided a login form, it more or less
 reverts to ChallengeAuthenticator's behavior? (Except the scheme won't be
 supported, so it won't actually work, but you'll have some clue as to
 what's going on.)

 --tim


 On Fri, Dec 21, 2012 at 11:57 AM, Thierry Boileau tboil...@restlet.comwrote:

 Hello Tim,

 I'm sorry for the delay of my answer.
 It clearly appears to me that the promised feature were not implemented,
 and therefore were lacking from the initial contribution.
 Thanks a lot for reporting this issue, I've added your contribution, with
 a small adjustement : I test the loginFormPath value. When it is null, we
 cannot redirect, therefore it calls super#challenge(Response, boolean).

 Best regards,
 Thierry Boileau

 --

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




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

Re: Conversion of primitive java Datatype double to OData Edm.Double

2012-12-21 Thread Thierry Boileau
Hi,

I meant 2.2m1.

Best regards,
Thierry Boileau


2012/12/21 Thierry Boileau tboil...@restlet.com

 Hi Martin,

 Thanks a lot for reporting this issue. The fix will be available in
 shortly comming releases 2.1.1 and 2.1m1.

 Best regards,
 Thierry Boileau

 --

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


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

RE: Don

2012-11-29 Thread Thierry Boileau
Hello Adrien,

are you hosting the application inside a servlet container? Which one?

Best regards,
Thierry Boileau

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


RE: Re: Re: Getting NullPointerException when trying to get serialized object

2012-11-29 Thread Thierry Boileau
Hi Diego,

of course, you can share the answer to stackoverflow.

Best regards,
Thierry Boileau

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


Re: controlling the max form size to protect against DoS attacks

2012-11-22 Thread Thierry Boileau
Hello Shaun,

I've entered a new issue for that:
https://github.com/restlet/restlet-framework-java/issues/687.
It is related to this one:
https://github.com/restlet/restlet-framework-java/issues/67

I think that the idea is to wrap the stream of the Representation in order
to count the number of read bytes.
You can for example use a Filter set up in front of the root Restlet of the
Restlet based application
This sample code leverages the BoundedInputStream class (of
org.apache.commons.io), which silently (which may not be convenient for
you) prevent from reading extra bytes.

@Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
[... definition of the router]

// filter the root router.
Filter filter = new Filter(getContext(), router) {
@Override
protected int beforeHandle(Request request, Response response) {
if (request.isEntityAvailable()) {
request.setEntity(new
WrapperRepresentation(request.getEntity()) {
public InputStream getStream() throws IOException {
InputStream result = super.getStream();
if (result != null) {
result = new BoundedInputStream(result, 2);
}
return result;
};
public String getText() throws IOException {
return BioUtils.toString(getStream(),
getCharacterSet());
};
});
}
return super.beforeHandle(request, response);
}
};
return filter;
}

I'm not sure it will be easy to inherit from httpServerHelper, adn I'm not
sure the property maxFormContentSize can be used in this context.

Best regards,
Thierry Boileau

Hi,

 Does Restlet expose a way to reject incoming requests which are too large?
  We are using Restlet on Jetty, and Jetty exposes this feature via the
 maxFormContentSize property (
 http://wiki.eclipse.org/Jetty/Howto/Configure_Form_Size), but I cant find
 a way to set this through Restlet.

 Do I have to create an extension to HttpServerHelper that overrides
 configure() to do this?

 --

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


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

Re: Re: status code REDIRECT in GWT

2012-11-22 Thread Thierry Boileau
Hi,

as far as I know this method does not help as the browser always follows
redirections.
We should depreciate this method in Restlet 2.1 and remove it from 2.2.

Best regards,
Thierry Boileau


I wasnt aware of the property, I will  give it a try.

 --

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


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

Re: Re: Android Client/GAE Server - 400 Bad Request

2012-11-22 Thread Thierry Boileau
Hi,

that's fine! I didn't notice that the @Get and @Delete methods where using
parameters.
In the Restlet framework, the parameter correspond to the entity of the
request. The other parameters located in the path or the query of the
URIs are, well, located in the URI and are part of the identification of
the resource.

Best regards,
Thierry Boileau

The problem is finally resolved!
 As i mentioned before in the previous release it was working, but after
 upgrading the app to the new Android platform and foundations, it stopped
 working. I didn't mention it, but only one method works

 @Put
 public void store(SafeNote note);
 Two other method are not working where i tried to send parameter.

 So, the solution was in interface class to remove parameter
 @Get
 public NoteList retrieve(); // see the original code in question.
 @Delete
 public void remove();  // see the original code in question.


 Second place to fix is this method implementation invocation: noteList =
 noteResource.retrieve(); // since i send parameter using URL template.(Same
 fix is for delete method).

 P.S. Thank you Thierry for your attention

 --

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


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

Re: Trouble with x-java-serialized-object...

2012-11-22 Thread Thierry Boileau
Hello Arnaud,

can you add the Jackson extension on server side (it provides an automatic
converter for json representations), and from the client side ask for the
json representation of the resource.
Either by setting up the accept header of the HTTP request, of by adding
the media=json parameter in the query string.

I've entered a new issue for that :
https://github.com/restlet/restlet-framework-java/issues/688

Best regards,
Thierry Boileau


Hi,
 On GAE Server I have these two entities:
 public class Convive implements Serializable, HasKey {
 @Id
 private Long id;
 private String identifiant;
 private KeyTypeConvive typeConvive;
 private boolean groupe;
 private int nombreConvives;
 private Key? entiteLiee;
 private Date dateEntree;
 private Date dateSortie;
 private KeyLieuLivraisonRepas lieuLivraisonRepas;
 private ListKeyItemProfilAlimentaire itemsProfilAlimentaire;
 private ListKeyItemDoublePortion itemsDoublePortion;
 private ListKeyItemFinition itemsFinition;
 private ListKeyTypeRepas typesRepasPresentDefaut;
 private String photoBlobKey;
 .
 .
 .
 }

 public class Plat implements Serializable, HasKey {
 @Id
 private Long id;
 private String nom;
 private String ttsName;
 private String photoBlobKey;
 private ListKeyTypePlat typesPlat;
 private ListKeyItemProfilAlimentaire
 compatibilitesAlimentaires;
 private ListKeyItemDoublePortion compatibilitesDoublesPortions;
 .
 .
 .
 }

 If I want to retrieve a List of all the Convive entities on a Java SE
 client, it works perfectly. The beginning of the response:
 HTTP/1.1 200 OK
 Content-Type: application/x-java-serialized-object
 Accept-Ranges: bytes
 Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
 Date: Fri, 07 Sep 2012 15:13:59 GMT
 Server: Google Frontend
 Content-Length: 25130

 If I do the same thing with a List of all Plat entities, the entities are
 returned (I can see them in Fiddler), but the deserialized object is null
 (without an error message). The beginning of the response:
 HTTP/1.1 200 OK
 Content-Type: application/x-java-serialized-object
 Date: Fri, 07 Sep 2012 15:20:04 GMT
 Accept-Ranges: bytes
 Server: Restlet-Framework/2.1m7
 Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
 Content-Length: 22172
 I thought it was a matter of length, but as you can see the content length
 of the Convive List is higher. But If I reduce the size of the returned
 Plat Entities to 14 entities, I have got the List deserialized (I tested
 that it is not the fifteenth entity which causes the trouble). But  The
 funniest thing is that if try these on a GWT client, everything works
 fine (using application/x-java-serialized-object+gwt serialization on the
 Java SE client might have solved the problem, but it seems that it is not
 possible: http://tinyurl.com/cap425w).
 Any clue will be welcomed.
 Thanks for your reading...

 --

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


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

Re: Restlet Versioning Scheme

2012-11-22 Thread Thierry Boileau
Hello Kevin,

we try our best to maintain compatibility from a version to the previous
one.
Sometimes classes are moving from one package to another which oblige you
to update the import path, sometimes API methods are not used any more but
we try to keep the old methods by depreciating them and by branching new
code from the old methods.
Note that when a method which is still in usage for example in 2.0 is
deprecated in 2.1, it will be removed in 2.2 (idem for 1.1 / 2.0 / 2.1).
If you are using extensions, some of them are relying on external
librairies. In this case, you have to take care of the new version of the
libraries java archives. They are all available in the /libraries
directory of the Restlet distribution.

If you are relying on the internal HTTP client and server connectors, I
suggest to move to ones provided by extensions such as net, httpclient,
jetty, simple since these internal connectors are on the way to be
stabilized.

I've read the changes.log (
http://www.restlet.org/documentation/2.1/jse/changes) and I think the
upgrade will be fine. The API is more stable then before.

Best regards,
Thierry Boileau


Will restlet 2.1 be backward compatible with applications developed for 2.0?
 Are you following a documented versioning scheme you can point me to, that
 states that versions with the same major number are backward compatible?

 We have an app based on 2.0 and I'm wanting to verify that we'll be able to
 drop in 2.1.0 when it is ready (and then regression test the app of
 course!)

 Thanks...



 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/Restlet-Versioning-Scheme-tp7578345.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

Re: Re: Overwriting ServerServlet issue

2012-11-22 Thread Thierry Boileau
Hi Hanno,

did you tell us the kind of servlet container you are using?

Best regards,
Thierry Boileau

Hi Thiery,

 don't know whether it helps but I ran it once in the YourKit profiler and
 the output for a single call with initialization first was
 https://dl.dropbox.com/u/317086/Screenshots/Restlet_Profiler.png

 Best regards,
 Hanno


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

Re: Android Client/GAE Server - 400 Bad Request

2012-11-15 Thread Thierry Boileau
Hello,

does it stop working only for PUT requests? In this case, this is due to an
issue with GAE (cf
http://wiki.restlet.org/docs_2.1/13-restlet/21-restlet/318-restlet/303-restlet.html
).
Resltet 2.1 proposes a fix for that :

GAE doesn't support HTTP chunked encoding, therefore serialized object
can't be sent (via POST or PUT) to a GAE server. In Restlet Framework
version 2.1 M4 we have a workaround available that buffers the HTTP entity
to prevent chunk encoding. To use it, call the
ClientResource#setRequestEntityBuffering(boolean) method with a true
value. Note that this workaround isn't required for the GWT edition.


Best regards,
Thierry Boileau

Hi,

 I had some working application
 Android/GWT client and GAE server. After upgrading my android version on
 my smartphone the android client stopped working however GWT still working
 until now.
 I used last production version(GWT/GAE/Restlet) that was distributed more
 than 2 years ago.

 Today i would like to fix the problem in Android client, but i get 400 Bad
 Request.
 I went over many documentation, forums, discussions, migration from
 restlet 1 to 2 with many possible solution, but nothing didn't work for me.

 Please find below my code and i will appreciate if you can point me to the
 resolution or can i try to make it working. Let me know if you need more
 information of my app. Thank you!

 Current versions:
 Restlet: 2.0.15
 GAE: 1.7.3
 GWT: 2.4


 
 ANDROID CLIENT:

 public interface NoteResource
 {
 @Get
 public NoteList retrieve(String userID);

 @Put
 public void store(SafeNote note);

 @Delete
 public void remove(String noteID);
 }

 Some code from the main class where i do invocation of the method
 Engine.getInstance().getRegisteredClients().clear();
 Engine.getInstance().getRegisteredClients().add(new
 org.restlet.ext.net.HttpClientHelper(null));
 ClientResource clientResource = new ClientResource(
 http://someapp.appspot/note/get/; + userID);
 noteResource = clientResource.wrap(NoteResource.class);
 noteList = noteResource.retrieve(signedUser);


 **

 GAE SERVER

 public class NoteApplication extends Application
 {
 private static final Logger logger =
 Logger.getLogger(NoteApplication.class.getName());

 /**
  * When launched as a standalone application.
  *
  * @param args
  * @throws Exception
  */
 public static void main(String[] args) throws Exception {
 Component component = new Component();
 component.getClients().add(Protocol.FILE);
 component.getServers().add(Protocol.HTTP, 8080);
 component.getDefaultHost().attach(new NoteApplication());
 component.start();
 }

 @Override
 public synchronized Restlet createInboundRoot() {
 Router router = new Router(getContext());
   getConnectorService().getClientProtocols().add(Protocol.FILE);
 // Serve the files generated by the GWT compilation step.
 File warDir = new File();
 if (!war.equals(warDir.getName())) {
 warDir = new File(warDir, war/);
 }

 Directory dir = new Directory(getContext(),
 LocalReference.createFileReference(warDir));
 router.attachDefault(dir);
 router.attach(/note, NoteResourceImpl.class);
 router.attach(/note/login, NoteResourceImpl.class);
 TemplateRoute routeGet = router.attach(/note/get/{userID},
 NoteResourceImpl.class);
 TemplateRoute routeDelete = router.attach(/note/delete/{NoteID},
 NoteResourceImpl.class);
 MapString, Variable routeVariables =
 routeGet.getTemplate().getVariables();
 routeVariables.put(userID, new
 Variable(Variable.TYPE_URI_QUERY_PARAM));
 routeVariables = routeDelete.getTemplate().getVariables();
 routeVariables.put(safeNoteID, new
 Variable(Variable.TYPE_URI_QUERY_PARAM));
 return router;

 --

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


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

RE: RESTful internationalization

2012-11-15 Thread Thierry Boileau
Hello Dustin,

I guess your problem is simpler than the one described by rebeltix, I guess 
it's only about the language.
You can have a look at this: http://www.cs.tut.fi/~jkorpela/flags.html.

Our point of view is that the target ServerResource relies only on the client 
preferences expressed by the request#clientInfo#acceptedlanguages.
It can be inferred from:
1/ the accept-language header (as defined by the browser), 
2/ the extension of the target resources 
(http://example.com/path/to/resource/resource.html.fr)
3/ the uri (http://example.com/fr/path/to/resource/resource.html, or 
http://fr.example.com/path/to/resource/resource.html).

In cases 2/ or 3/ a Filter is necessary in order to detect the language and set 
the request#clientInfo#acceptedlanguages property.
2/ is already assumed by the TunnelFilter (see 
http://www.restlet.org/documentation/2.1/jse/api/org/restlet/service/TunnelService.html).
3/ requires you to add your own filter.

You can even define a hierarchy between 1/, 2/ and 3/: as users may not be 
aware of the browser preferences, these preferences have a smaller priority 
than preferences expressed by 2/ and 3/.

The restlet.com site is based on 1/ and 2/.

By the way, I'm quite surprised by the fact that rebeltix seems to link 
translation of content and localization of the user in order to present 
distinct prices and payment methods for example. People can browse Internet 
from Germany, speak English, and receive its command in another country (and 
thus the cost could be adjusted according to the shipping address).

Best regards,
Thierry Boileau

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


RE: Overwriting ServerServlet issue

2012-11-15 Thread Thierry Boileau
Hello Hanno,

I understand that this could be enhanced. At the creation of the Component, 
we should be able to know if the Component is the default one or not. 
I've entered an issue for that : 
https://github.com/restlet/restlet-framework-java/issues/686


Having said that, I have a little worry: what do you mean by long startup 
times?

Best regards,
Thierry Boileau

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


RE: status codes in GWT client - responding to validation or business exception

2012-11-15 Thread Thierry Boileau
Hi Koen,

regarding the status and entity of the response, they are still available via 
the clientResource:

final ContactResourceProxy contactResource = 
GWT.create(ContactResourceProxy.class);
contactResource.getClientResource().setReference(/contacts/123);
contactResource.retrieve(new ResultContact() {
public void onFailure(Throwable caught) {
// Gives access to the real response error status code.
contactResource.getClientResource().getStatus().getCode();
// Gives access to the real response entity.
contactResource.getClientResource().getResponseEntity();
}
public void onSuccess(Contact contact) {
[...]
}
});

I guess there is room for improvement. I let the issue #411 open, and adds this 
answer.


Best regards,
Thierry Boileau

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


Re: status code REDIRECT in GWT

2012-11-15 Thread Thierry Boileau
Hi Koen,

I've added you as approved suscriber...

Bes tregards,
Thierry Boileau

Ok, more investigation shows that I *can* get hold of all the data in case
 of a error status code via the clientresource-getresponse. That's just
 fine.

 Except for redirection, because this is automatically being followed. So
 my GWT call receives the HTML of the login after redirection.

 How do I deal with that ? I would rather receive the redirection status
 code and redirect the whole webapp then receive the HTML when calling for
 e.g. a list of contacts.


 PS: I can't reply to the prev msg because it is not yet approved :-/

 --

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


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

Re: Overwriting ServerServlet issue

2012-11-15 Thread Thierry Boileau
Hi Hanno,

The first request took 6-12 seconds
wow, that's too long... I've never seen that...
I wil check on a PC with Window 7 also.

Best regards,
Thiery Boileau

ps :
I've meant the time which is used before the first request is processed,
but we have only seen that on Windows 7.
you're right, actually the application is not started at the same time than
the servlet container, but is lazily loaded at the first request.

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

Re: http://wiki.restlet.org/ unavailable

2012-11-01 Thread Thierry Boileau
Hello Ralph,

thanks for reporting this issue. I'm having a look at this.

Best regards,
Thierry Boileau


Hi,

 I noticed a couple of days ago http://wiki.restlet.org/ is unavailable.

 Is there any idea on when it will be back?

 Thanks.

 Ralph.

 --

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


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

Re: http://wiki.restlet.org/ unavailable

2012-11-01 Thread Thierry Boileau
Hello all,

I've restarted the wiki which is up again.

Best regards,
Thierry Boileau


Hello Ralph,

 thanks for reporting this issue. I'm having a look at this.

 Best regards,
 Thierry Boileau



 Hi,

 I noticed a couple of days ago http://wiki.restlet.org/ is unavailable.

 Is there any idea on when it will be back?

 Thanks.

 Ralph.

 --

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




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

RE: Re: Restlets in gwt with json

2012-10-26 Thread Thierry Boileau
Hello Xavier,

your code works for me also using the RC6 or 2.1.0 release. I've updated my 
sample project, with several ways to do the same thing.

I hope this will help you.

Best regards,
Thierry Boileau

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


Re: Hiding Restlet LogFilter#afterHandler log

2012-10-25 Thread Thierry Boileau
Hello William,


Actually this is due to the java.util.logging.SimpleFormatter used by the
JDK by default which not only logs the LogRecord generated by any call to
Logger#fine, Logger#severe, etc, but also an additional line with the date,
source method, etc.
You can set up the a logHandler and specify a simpler Formatter, for
example the org.restlet.engine.log.AccessLogFormatter.
You can have a look at the standard
documentationhttp://docs.oracle.com/javase/1.5.0/docs/guide/logging/index.htmlor
here http://wiki.restlet.org/docs_2.0/13-restlet/101-restlet.html.


Best regards,
Thierry Boileau


I've configured logging.properties to only show WARNING level logs for
 Restlet and while that generally seems to work, I always get log entry for
 every request for the LogFilter istelf. Eg

 2012-10-21 15:10:47.638 org.restlet.engine.log.LogFilter afterHandle:
 2012-10-2105:10:47101.165.32.41

 Here is my logging.properties
 .level=INFO
 org.restlet.level=WARNING
 org.restlet.engine.log.LogFilter.level=WARNING


 Any ideas of why this is occuring and how to gte rid of it?

 William

 --

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


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

Re: Restlet client hanging when connecting to Restlet server (SunOS)

2012-10-25 Thread Thierry Boileau
Hello Noam,

I'm currently using the net client connector for customer in production
environment. Using the HttpClient extension is fine also.

Best regards,
Thierry Boileau


Thanks for your reply Jerome!

 It is working fine on SunOS with the org.restlet.ext.net connector!

 I will also test with the httpclient connector.  Is this connector
 recommended for production?

 Thanks again!

 --

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


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

Re: Posting files without writing them to disk

2012-10-08 Thread Thierry Boileau
Hello Bjorn,

from what I see, you are following the right way (see
http://www.restlet.org/documentation/2.1/jse/ext/org/restlet/ext/fileupload/RestletFileUpload.html#getItemIterator%28org.restlet.representation.Representation%29
)

Best regards,
Thierry Boileau
ps : there could be another way using the FormDataSet class taken from the
org.restlet.ext.html extension. But there's something I miss about the aim
of this class. I check with Jérôme.

Hey all,

 I'm trying to create an endpoint on my server where users can post one or
 more large files. These files will then be processes and pushed to S3. For
 testing purposes, I am not processing and pushing to S3 yet, just
 calculating an sha1 hash and printing it to std out. The code below works,
 but I couldn't figure out how to do this without accessing classes called
 FileItemStream and, more ominously, DiskFileItemFactory, so I wanted to
 make sure this code doesn't actually try to write the files to disk. I want
 the input stream to be pulling the data straight from the client. I don't
 see another way to do this.

 I am using org.restlet.ext.fileupload

 thanks!

 @Post(multipart)
 public Representation postFiles(Representation entity) {
 if( entity == null ) {
 return fail( Status.CLIENT_ERROR_BAD_REQUEST,
 Multipart/form-data required );
 }
 if( ! MediaType.MULTIPART_FORM_DATA.equals(entity.getMediaType(),
 true) ) {
 return fail( Status.CLIENT_ERROR_BAD_REQUEST,
 Multipart/form-data required );
 }
 DiskFileItemFactory factory = new DiskFileItemFactory();
 RestletFileUpload upload = new RestletFileUpload(factory);
 try {
 FileItemIterator fii =
 upload.getItemIterator(entity);
 while( fii.hasNext() ) {
 MessageDigest md =
 MessageDigest.getInstance(SHA-1);
 FileItemStream fis = fii.next();
 InputStream is = fis.openStream();

 while( true ) {
 byte[] input = new byte[1024];
 int amount = is.read(input);
 if( amount == -1 )
 break;
 md.update(input, 0, amount);
 }
 is.close();

 byte[] sha1hash = md.digest();
 System.out.println( fis.getFieldName() + 
 :  + fis.getName() +  :  + byteArray2Hex(sha1hash) );
 }
 } catch (FileUploadException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 } catch (IOException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 } catch (NoSuchAlgorithmException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }
 

 -
 Bjorn Roche
 http://www.xonami.com
 Audio Collaboration
 http://blog.bjornroche.com

 --

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


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

Re: Getting NullPointerException when trying to get serialized object

2012-10-03 Thread Thierry Boileau
Hello Diego,

the common classes between the server and client parts (such as the classes
for the bean objects that are serialized/deserialized) must be located in
the same packages. The reason is that the serialization/deserialization
process leverages conventions, in particular convention regarding the full
path of the bean classes are referenced inside the JSON representation.
All other classes such as ClientResource, annotated interfaces could be
located in distinct packages between client/server projects.

Best regards,
Thierry Boileau


After trying many many many many things I made it work. I asked in the
 Restlet Mailing list too, and I will comment this same thing there.

 In the try/catch block I put this:


 Log.w(json
 get(MediaType),cr.get(MediaType.APPLICATION_JSON).toString());
 ObjectRepresentationDBUser r = new
 ObjectRepresentationDBUser(cr.get());
 Log.w(get user,r.getObject().toString());

 And all I got was a ClassNotFoundException because my Android device said
 it couldn't find the com.server.common.MyUser class, I renamed both
 server and clients packages to the same name and it worked.

 Is it necessary that the packages are the same too?

 --

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


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

Re: Re: MyStatusService not invoked after MyRepresentation throws exception

2012-10-03 Thread Thierry Boileau
Hello Jim,

thanks for the sample code, I understand the issue and have entered a new
one in github : https://github.com/restlet/restlet-framework-java/issues/670
.

Best regards,
Thierry Boileau


Thierry -

 I very much appreciate your reply, but TestApplication does not take into
 account a custom Representation that may fail.  I've changed the
 TestApplication class to TestApplicationJim to better explain what I am
 trying to do.  The RepresentationFails class demonstrates that the methods
 in MyStatusService are never invoked.

 As succinctly as I can state it: If a write operation in a custom
 representation fails, no method in the customized StatusService is invoked.

 FYI - The Restlet code is excellent, and I have improved my coding style
 after learning from yours.

 Code is below, and also attached


 package test;

 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Reader;
 import java.io.Writer;
 import java.nio.channels.ReadableByteChannel;
 import java.nio.channels.WritableByteChannel;

 import org.restlet.Application;
 import org.restlet.Component;
 import org.restlet.Request;
 import org.restlet.Response;
 import org.restlet.data.MediaType;
 import org.restlet.data.Protocol;
 import org.restlet.data.Status;
 import org.restlet.representation.OutputRepresentation;
 import org.restlet.representation.Representation;
 import org.restlet.resource.ClientResource;
 import org.restlet.resource.ResourceException;
 import org.restlet.routing.Router;

 public class TestApplicationJim extends Application {

 /**
  * @param args
  * @throws Exception
  */
 public static void main(String[] args) throws Exception {
 Component c = new Component();
 c.getServers().add(Protocol.HTTP, 8182);
 c.getDefaultHost().attach(new TestApplicationJim());
 c.start();
 System.out.println(TestApplicationJim started);

 ClientResource cr = new ClientResource(
 http://localhost:8182/test1;);
 cr.setRetryOnError(false);
 try {
 cr.get();
 } catch (Exception e) {
 cr.getResponseEntity().write(System.out);
 }

 cr = new ClientResource(http://localhost:8182/test2;);
 cr.setRetryOnError(false);
 try {
 cr.get();
 } catch (Exception e) {
 cr.getResponseEntity().write(System.out);
 }
 c.stop();
 }

 public void handle(Request request, Response response) {
 System.out.println(TestApplicationJim handle);
 class RepresentationFails extends OutputRepresentation {

 public RepresentationFails() {
 super(MediaType.APPLICATION_ZIP, -1);
 }

 @Override
 public ReadableByteChannel getChannel() throws IOException {
 throw new
 ResourceException(Status.CLIENT_ERROR_NOT_ACCEPTABLE);
 }

 @Override
 public Reader getReader() throws IOException {
 throw new
 ResourceException(Status.CLIENT_ERROR_NOT_ACCEPTABLE);
 }

 @Override
 public InputStream getStream() throws IOException {
 throw new
 ResourceException(Status.CLIENT_ERROR_NOT_ACCEPTABLE);
 }

 @Override
 public void write(Writer writer) throws IOException {
 throw new
 ResourceException(Status.CLIENT_ERROR_NOT_ACCEPTABLE);
 }

 @Override
 public void write(WritableByteChannel writableChannel) throws
 IOException {
 throw new
 ResourceException(Status.CLIENT_ERROR_NOT_ACCEPTABLE);
 }

 @Override
 public void write(OutputStream outputStream) throws
 IOException {
 throw new
 ResourceException(Status.CLIENT_ERROR_NOT_ACCEPTABLE);
 }

 }
 response.setEntity(new RepresentationFails());
 }

 public TestApplicationJim() {
 super();
 setStatusService(new MyStatusService());
 }

 public org.restlet.Restlet createInboundRoot() {
 Router router = new Router(getContext());
 router.attach(/test1, TestExceptionServerResource.class);
 router.attach(/test2, TestResourceExceptionServerResource.class);
 return router;
 };

 }

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

Re: Re: Getting NullPointerException when trying to get serialized object

2012-10-03 Thread Thierry Boileau
Hello Diego,

I think it's fine if you share my answer of course!

Best regards,
Thierry Boileau


Thank you very much, Thierry.

 I asked the same in Stackoverflow.com, if you don't have any problem I
 will share your answer there too.

  Hello Diego,
 
  the common classes between the server and client parts (such as the
 classes
  for the bean objects that are serialized/deserialized) must be located in
  the same packages. The reason is that the serialization/deserialization
  process leverages conventions, in particular convention regarding the
 full
  path of the bean classes are referenced inside the JSON representation.
  All other classes such as ClientResource, annotated interfaces could be
  located in distinct packages between client/server projects.
 
  Best regards,
  Thierry Boileau


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

Re: nio controller freezes occasionally

2012-09-26 Thread Thierry Boileau
Hello Jing,

thanks for reporting this issue.
At this moment, I have a simple advice to give. The internal connectors are
not fully ready for production system, we still encourage you to use the
Jetty and Simple extensions.
Having said that, we are aware that in some cases the internal connectors
freeze, and we are on the way to stabilize them. On our side we have some
reproductible scenario that should help us to enhance these connectors, but
need some time to fix the issues. Please stay tuned.

Best regards,
Thierry Boileau


Hi,

 I'm running into an interesting scenario with Restlet 2.1-RC6 with the
 Spring and Jackson extensions. I apologize for this lengthy message, and
 even though I have got to a point where I can consistently reproduce the
 scenario, I haven't been able to reduce it to a simple test case. So here
 it goes:

 There are two standalone JSE processes, proc1 and proc2. They are
 long-running and exchange REST messages between themselves.  There is a
 third client program which runs from command line from time to time to
 query some status data from proc1 via REST. It prints the status, and exits.

 Occasionally this client would hang after sending the status request. If I
 turn Restlet logging to TRACE (in slf4j), client would get stuck proc1
 seems to always stop after the NIO controller prints a about to sleep
 message.

 While the client is waiting there, if I somehow cause proc2 to send proc1
 any request, it would actually wake up the selector in proc1. It would
 start processing proc2's request, then proceed to write the previously
 hanging response to the client. In proc1's log it would seem like the NIO
 controller gets waken up with a selected 1 key message.

 I'm attaching a fragment of the log, with the big gap between the two NIO
 controller messages marked. I understand that there aren't a lot of
 concrete data to work with, but any thoughts or pointers are much welcome
 and appreciated.

 Thanks
 -jx


 --- 22:50:41.002 TRACE Restlet-1186010055 [   ] org.restlet
 NIO controller woke up
 --- 22:50:41.002 TRACE Restlet-35138160 [   ] org.restlet
 NIO controlled selected no key
 --- 22:50:41.002 TRACE Restlet-35138160 [   ] org.restlet
 Handling response...
 --- 22:50:41.002 TRACE Restlet-35138160 [   ] org.restlet
 Connection status: CLOSED | IDLE, IDLE, java.nio.HeapByteBuffer[pos=0
 lim=16384 cap=16384], FILLING, true | IDLE, IDLE,
 java.nio.HeapByteBuffer[pos=0 lim=32768 cap=32768], FILLING, true |
 true|Interest= READ , Ready=NONE , Canceling=false
 --- 22:50:41.003 TRACE Restlet-35138160 [   ] org.restlet
 InboundWay#clear: IDLE, IDLE, java.nio.HeapByteBuffer[pos=0 lim=16384
 cap=16384], FILLING, true
 --- 22:50:41.003 TRACE Restlet-35138160 [   ] org.restlet
 OutboundWay#clear: IDLE, IDLE, java.nio.HeapByteBuffer[pos=0 lim=32768
 cap=32768], FILLING, true
 --- 22:50:41.003 TRACE Restlet-35138160 [   ] org.restlet
 InboundWay#clear: IDLE, IDLE, java.nio.HeapByteBuffer[pos=0 lim=16384
 cap=16384], FILLING, true
 --- 22:50:41.003 TRACE Restlet-35138160 [   ] org.restlet
 OutboundWay#clear: IDLE, IDLE, java.nio.HeapByteBuffer[pos=0 lim=32768
 cap=32768], FILLING, true
 --- 22:50:41.003 TRACE Restlet-35138160 [   ] org.restlet
 NIO controller about to sleep 1 ms...

 ==GAP HERE===
 No more logging from restlet here until another
 request comes in below.
 ===

 --- 22:50:51.100 TRACE Restlet-35138160 [   ] org.restlet
 NIO controller selected 1 key(s) !
 --- 22:50:51.100 TRACE Restlet-35138160 [   ] org.restlet
 ReadableSocketChannel created from:
 java.nio.channels.SocketChannel[connected local=/127.0.0.1:9494 remote=/
 127.0.0.1:52530],Interest= NONE , Ready=NONE , Canceling=false.
 Registration: Interest= NONE , Ready=NONE , Canceling=false
 --- 22:50:51.100 TRACE Restlet-35138160 [   ] org.restlet
 Connection state (old | new) : OPENING | OPEN
 --- 22:50:51.100 TRACE Restlet-35138160 [   ] org.restlet
 InboundWay#setIoState: INTEREST
 --- 22:50:51.100 TRACE Restlet-35138160 [   ] org.restlet
 InboundWay#setMessageState: START
 --- 22:50:51.100 TRACE Restlet-35138160 [   ] org.restlet
 Old connection NIO interest: Interest= NONE , Ready=NONE , Canceling=false
 --- 22:50:51.100 TRACE Restlet-35138160 [   ] org.restlet
 New connection NIO interest: Interest= READ , Ready=NONE , Canceling=false
 --- 22:50:51.101 DEBUG Restlet-35138160 [   ] org.restlet
 Connection from /127.0.0.1:52530 accepted. New count: 2
 --- 22:50:51.101 TRACE Restlet-35138160 [   ] org.restlet
 Connection status: OPEN | IDLE, IDLE, java.nio.HeapByteBuffer[pos=253
 lim=253 cap=16384], DRAINING, true | IDLE, IDLE,
 java.nio.HeapByteBuffer[pos=0 lim=32768 cap=32768], FILLING, true |
 false|Interest= READ , Ready=READ , Canceling=false
 --- 22:50:51.101 TRACE Restlet-35138160 [   ] org.restlet
 InboundWay#setMessageState: START
 --- 22:50:51.101 TRACE Restlet-35138160 [   ] org.restlet
 OutboundWay#setIoState: INTEREST
 --- 22:50:51.101 TRACE Restlet-35138160

Re: ClientRestlet speed compare to apache Httpclient

2012-09-26 Thread Thierry Boileau
Hello,

do you mean the HttpClient extension for the Restlet framework?

Best regards,
Thierry Boileau


i access a remote restlet server using ClientRestlet and Httpclient, the
 clientresource seems to be
 slower than httpclient, i debug the open source,
 BaseClientHelper.handle(Request request, Response response)'s

 .. if (!latch.await(NioUtils.NIO_TIMEOUT, TimeUnit.MILLISECONDS))
 {.
 takes most of time.

 who can show me the reason, and how to resovle the problem!
 thanks!



 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/ClientRestlet-speed-compare-to-apache-Httpclient-tp7578359.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

Re: GWT Edition does not work with latest GWT toolkit 2.5.0-rc1

2012-09-19 Thread Thierry Boileau
Hello Koen,

I've updated the 2.1 and the master branches in order to support GWT 2.5.
It will be part of the next 2.1.0 release.

Best regards,
Thierry Boileau

see
 http://stackoverflow.com/questions/12230932/restlet-proxy-generation-fails-with-latest-gwt-2-5-0-rc1

 Is this a known problem ?

 --

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


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

Re: The parent context doesn't have a client dispatcher available. Unable to handle call.

2012-08-30 Thread Thierry Boileau
Hello Sasi,

I wonder if the client connector has been correctly defined (see here
http://www.restlet.org/documentation/2.1/jee/ext/org/restlet/ext/servlet/ServerServlet.html
).
In the web.xml file, you should see the configuration of a
org.restlet.clients parameter:

init-param
  param-nameorg.restlet.clients/param-name
  param-valueHTTP/param-value
/init-param

It contains the list of protocols supported by the host component.
Otherwise, any kind of sample source code is welcomed.

Best regards,
Thierry Boileau


Hello

 ** **

 *The parent context doesn't have a client dispatcher available. Unable to
 handle call.*



 ** **

 ** **

 Refererence:

 Version: 2.1RC2, 2.1RC5  2.1RC6

 Context:  I use Restlet server and client in GAE environment

 When exception happens: After posting when I read response using
 Representation it happens.

 ** **

 JacksonRepresentationNetworkProductOrder productOrderRep = new
 JacksonRepresentationNetworkProductOrder(output,
 NetworkProductOrder.class);
 productOrder = productOrderRep.getObject(); 

 ** **


 *Exception message*
 org.restlet.engine.util.ChildClientDispatcher parentHandle: The parent
 context doesn't have a client dispatcher available. Unable to handle call.
  

 ** **

 *Conditionally Working:*

 ** **

 If I comment

 servlet and servlet-mapping element for restlet in web.xml, it works.
 ( meaning client works fine, natually no restlet server )

 ** **

 ** **

 ** **

 ** **

 My post in “Restlet Discuss” is given below

 ** **


 http://restlet-discuss.1400322.n2.nabble.com/The-parent-context-doesn-t-have-a-client-dispatcher-available-Unable-to-handle-call-td7578291.html
 

 ** **

 Thanks

 Sasi Marian


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

Re: getRemoteUser() with org.restlet.ext.servlet

2012-08-30 Thread Thierry Boileau
Hello Stephen,

did you check the Request#getChallengeResponse() object?
How is sent the identifier of the remote user?

Best regards,
Thierry Boileau

Is there a way to get javax.servlet.http.HttpServletRequest.getRemoteUser()
 when using org.restlet.ext.servlet ?

 Spring allows one to get to it this way:

 org.springframework.web.context.request.ServletRequestAttributes sra =
 (org.springframework.web.context.request.ServletRequestAttributes)
 org.springframework.web.context.request.RequestContextHolder.getRequestAttributes();

 javax.servlet.http.HttpServletRequest request = sra.getRequest();
 request.getRemoteUser()

 --

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


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

Re: Re: Re: Parameters for annotated resources with interface?

2012-08-14 Thread Thierry Boileau
Hello Norm,

the API proposed by the Restlet framework is quite distinct than, let's
say, the jaxrs one. Especially regarding the handling of query parameters
and request's entity.

At first, there is a big wall between URIs that identify a resource, and
the request's entities wich is, in case of a PUT requests represents the
new state of the target resource.
According to the specification, the query part of the URL combines two
aspects : it is still part of the resource's identifier, and it can be read
a set of parameters.
Using the Restlet framework, another kind of parameters can be read from
the URIs : they are located in the path of the URL, and are defined using
the routing API of the framework. The following instruction defines a URI
template which contains one parameter called id :
router.attach(/account/{id}, AccountServerResource.class);
This URI template allows the framework to define a new route, and to
correctly transmit the control to the right resource at runtime.
Query parameters can be accessed using the resource' reference or directly
using some shortcuts (ServerResource#getQuery, for example), URIs
parameters are accessed, as said Tim, using the
ServerResource#getRequestAttributes method.

As also said Tim, the support of annotations in the Restlet framework can
be seen as a way to define Java method synonyms to technical HTTP methods,
with an important constraint: by design, there could be at most one
parameter which represents the request's entity (as a simple Representation
object, or as a deserialized customized object). The provided set of
annotations helps to link Java methods with HTTP ones, and annotation
parameters add a level of automation using the media type of the request
and/or response entity. The idea is that, when the ServerResource class is
instantiated and the ServerResource#doInit is invoked, you can get all
the parameters taken from the URI that identify the resource and check if
the resource really exists (there is a ServerResource#setExisting method),
or not, without considering any other aspects of the request. Then, the
request's entity is taken into consideration.

I hope this will give you a little bit more of explanations.

Best regards,
Thierry Boileau





Thanks Tim!

 --

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


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

  1   2   3   4   5   6   7   8   9   10   >