jaxrs + embedded jetty

2011-05-25 Thread lambdad...@gmail.com
Hi Folks
I am trying to develop a jax-rs based application using restlet, howbeit
using the jetty server instead of default http server (org.restlet.Server).
Is this info. available somewhere on your website? I didn't find it.
The maven dependencies for the jetty are not up-to-date on the repo. as
well.
Thanks,
Daku

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/jaxrs-embedded-jetty-tp6394909p6394909.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


RE: Re: Different deployment schemes for the same Restlet-based Application

2011-05-25 Thread Tal Liron
Fabian,

This is the $1,000,000 question, quite literally. I happen to think that 
deployment -- a term often considered by engineers only at the very end of 
their project -- is more likely close to 50% of their work effort. I've never 
seen any real-life project for real people (other than some open source library 
released to a few geeks) that doesn't have serious and expensive deployment 
challenges.

Though Tim is apologizing for his elaborate answer, if anything it's too 
simplistic: this is an enormous challenge that can't be solved in a simple 
email.

If you wait for Jerome's Restlet book, it will offer you quite a bit of advice 
on deployment! From what I read in the early version, it's not a small chapter, 
and it still only scraped the surface.

JEE is one way to go: there are big, complicated products out there (JBoss) 
that implement deployment standards in complex ways that have proven themselves 
in many enterprises. People also seem to like adding Maven, OSGi and other 
technologies in their deployments, trying to integrate development with 
deployment. Perhaps a developer's pipe dream? I'm a consultant who has left the 
enterprise behind, and see a lot of my clients are trying to move away from 
this old, heavy term and think in more agile ways.

I love Restlet and can't think of a better way to develop internet/intranet 
applications right now, in any language and on any platform. Which is why I 
decided to develop a container for Restlet applications that is based on 
Restlet and not JEE, and is more oriented towards agile than the enterprise:

http://threecrickets.com/prudence/

It started pretty much like Tim: I was rolling my own until I realized that I 
can't keep rolling my own for every new client without exhausting myself, and 
that other people could benefit and help me in my work.

Viva open source!

-Tal

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


org.restlet.lib.com.google.protobuf

2011-05-25 Thread Ishaaq Chandy
Hi,
Am interested in setting up Resources that use protobuf messages for data
transfer. After some searching around I discovered this:
http://maven.restlet.org/org/restlet/jee/org.restlet.lib.com.google.protobuf/2.2/

Is anyone maintaining this? Where is the source?

If not, if I were to roll my own implementation - where should I start?

Ishaaq

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

Re: Form POST does not seem to work under Google App Engine

2011-05-25 Thread John Clarke
I seem to have posted this message twice, sorry about that!

I'm using Restlet v2.0.6. I've noticed that v2.0.7 has been released so I'll
try that but I dont see anything in the change log that would help this
issue.

Cheers.





On 24 May 2011 17:55, John Clarke clarke...@gmail.com wrote:







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

Re: Differences @Get x @GET; @Post x @POST with @Path

2011-05-25 Thread Thierry Boileau
Hello Bruno,

Using @Get or @Post (from org.restlet) didn't work at all.
These annotations are totally not part of the jaxrs api and cannot be used
in conjunction with the @Path annotation.

In order to use these annotations, you only need the core module
(org.restlet.jar). I wonder if the annotated ServerResourcehas been attached
to the application's router. Could you have a look here for a detailled
sample code? http://wiki.restlet.org/docs_2.1/13-restlet/303-restlet.html.

I think you will find some answert to your questions.

Best regards,
Thierry Boileau

I'm developing an application where a POST to /operations will create a new
 Operation, a GET to /operations/{code} will either return the Operation in
 XML or in JSON, depending on the Header parameter Accept.

 In order to achieve the path, I had to use @Path(operations) in the class
 declaration and @Path({code}) in the GET methods.

 Using @Get or @Post (from org.restlet) didn't work at all. But when I
 changed it to @GET and @POST (from javax.ws) it worked as expected.

 So I have three questions:

 1- Is it possible to use @Get and @Post with @Path?
 2- What are the differences between: @Get and @GET; and between @Post and
 @POST (because it seems using @GET and @POST I can do more things)?
 3- If they have different purposes, then am I supposed to annotate my
 methods with both @Get and @GET?

 --

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

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

Re: org.restlet.lib.com.google.protobuf

2011-05-25 Thread Thierry Boileau
Hello Ishaaq,

this maven artefact is actually the google protobuf library. It is used by
the sdc extension.
If you want to implement an extension that provides conversion to and from
protobuf protocol, you can have a look at the jackson extension. You should
have to implement only two classes : a protobuf converter and a protobuf
representation.

Bes tregards,
Thierry Boileau

Hi,
 Am interested in setting up Resources that use protobuf messages for data
 transfer. After some searching around I discovered this:
 http://maven.restlet.org/org/restlet/jee/org.restlet.lib.com.google.protobuf/2.2/

 Is anyone maintaining this? Where is the source?

 If not, if I were to roll my own implementation - where should I start?

 Ishaaq


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

Re: jaxrs + embedded jetty

2011-05-25 Thread Thierry Boileau
Hello Daku,

if you intend to use the jetty extension (which is actually what we call a
server connector), you can have a look at this page:
http://wiki.restlet.org/docs_2.0/13-restlet/37-restlet.html.
It describes how to complete the classpath with the required jars (in your
case, the org.restlet.ext.jetty.jar + the jetty and servlet libraries which
are provided by the restlet distribution in the lib directory).

Best regards,
Thierry Boileau


Hi Folks
 I am trying to develop a jax-rs based application using restlet, howbeit
 using the jetty server instead of default http server (org.restlet.Server).
 Is this info. available somewhere on your website? I didn't find it.
 The maven dependencies for the jetty are not up-to-date on the repo. as
 well.
 Thanks,
 Daku

 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/jaxrs-embedded-jetty-tp6394909p6394909.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

Re: Trouble creating restlet client on android

2011-05-25 Thread Thierry Boileau
Hello Mike,

did you have a look at this sample app ? It should contain your answer.
http://wiki.restlet.org/docs_2.0/13-restlet/303-restlet.html

best regards,
Thierry Boileau

A couple of other notes:

 (1) A simple client that uses the built in Apache HttpClient library
 instead
 of the restlet library works just fine.

 (2) When the restlet client is launched, there is a long pause, then it
 times out with the message box: The application MyApp (process
 mypackage.restlet) has stopped unexpectedly.  Please try again.

 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/Trouble-creating-restlet-client-on-android-tp633p6400554.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

RE: Restlet 2.1-Snapshot and GWT 2.3

2011-05-25 Thread Dimitri
I go back to gwt 2.2.. cool

Downloaded here:
http://google-web-toolkit.googlecode.com/files/gwt-2.2.0.zip

With eclipse: Window - Preferences - Google  Web toolkit
Add a new sdk providing the path where you extracted gwt

Right clic on your gwt project, properties - Google  Web toolkit
Select Use default SDK (gwt 2.2)

Good luck

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Restlet-2-1-Snapshot-and-GWT-2-3-tp6385471p6404293.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


Re: Restlet 2.1-Snapshot and GWT 2.3

2011-05-25 Thread Thierry Boileau
Hello Dimitri,

I've just fixed the snapshot, you can go back to GWT 2.3. :)

Best regards,
Thierry Boileau

I go back to gwt 2.2.. cool

 Downloaded here:
 http://google-web-toolkit.googlecode.com/files/gwt-2.2.0.zip

 With eclipse: Window - Preferences - Google  Web toolkit
 Add a new sdk providing the path where you extracted gwt

 Right clic on your gwt project, properties - Google  Web toolkit
 Select Use default SDK (gwt 2.2)

 Good luck

 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/Restlet-2-1-Snapshot-and-GWT-2-3-tp6385471p6404293.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

Re: How to add header for http request

2011-05-25 Thread Thierry Boileau
Hello Clement,

basically, the request has to be updated as follow:

Form headers = (Form)
request.getAttributes().get(HeaderConstants.ATTRIBUTE_HEADERS);
if (headers == null) {
 headers = new Form();
 request.getAttributes().put(org.restlet.http.headers, responseHeaders);
}
headers.add(X-Some-Header, the value);

As I don't know how you issue your client requests, please feel free to ask
for more details.

and also any information about the support of GWT 2.3...
I've just fixed the generation of the snapshot of the current trunk :
http://www.restlet.org/downloads/unstable

Best regards,
Thierry Boileau

Hello,

 I'm brand new on this forum... Actually, I'm trying to use the restlet
 client part framework to send a request to an existing REST server which
 needs custom attributes in the HTTP header. I've tested and read that GWT
 2.3 is not yet supported, so I 'm using GWT 2.2 with the pacakge
 org.restlet.gwt 2.1-M3.

 I've tried your solution, but when I'm debugging the request sent via
 Firebug, I can see that my custom attributes are added in an overall
 attribute called Access-Control-Request-Headers, so the values are not
 included, just the attributes names are included, and it's not well
 understood by the remote REST server...

 = What I would like to have :

 GET http://[...]
 Host: [...]
 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17)
 Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 Accept-Language: en-us,en;q=0.5
 Accept-Encoding: gzip,deflate
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive: 115
 Proxy-Connection: keep-alive
 Origin: http://127.0.0.1:
 first-custom-attribute: firstValue
 second-custom-attribute: secondValue


 = What I got :

 OPTIONS http://[...]
 Host: [...]
 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17)
 Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 Accept-Language: en-us,en;q=0.5
 Accept-Encoding: gzip,deflate
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive: 115
 Proxy-Connection: keep-alive
 Origin: http://127.0.0.1:
 Access-Control-Request-Method: GET
 Access-Control-Request-Headers:
 first-custom-attribute,second-custom-attribute


 If you have any idea... and also any information about the support of GWT
 2.3...

 Thanks
 Bye, Clement.


 --
 View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/How-to-add-header-for-http-request-tp5662743p6397880.html
 Sent from the Restlet Discuss mailing list archive at Nabble.com.

 --

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


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

Re: Unable to find a converter for this representation : [application/json,UTF-8]

2011-05-25 Thread Thierry Boileau
Hello Daku,

I suppose your client application misses a json converter.
Could you try to use the json extension and complete the classpath with the
org.restlet.ext.json.jar lib and json lib (see the lib directory of the
restlet distribution).

Best regards,
Thierry Boileau

Hello,
 Le 23/05/2011 23:19, lambdad...@gmail.com a écrit :
  Hi,
  I have a very simple jaxrs application, having the resource class
  containing a method returning a JSONObject. However on the client side I
  am trying to print the returning while calling the get (see below)
 
  Client side:
   ClientResource cr = new
  ClientResource(http://localhost:8182/service;);
   cr.getConverterService().setEnabled(true);
 
   cr.get(MediaType.APPLICATION_JSON).write(System.out);
 I think what happen is, with this line, you read the stream and exhaust
 it. After that, you can not read it again from the client resource.
 I hope I don't mislead you.
 Regards,
 Laurent.
 
   cr.get(ServiceResourceImpl.class).getServiceDescription();
   String jo =
  cr.get(ServiceResourceImpl.class).getServiceDescription();
 
  The last two methods return the following errors:
 
  WARNING: Unable to find a converter for this representation :
  [application/json,UTF-8]
  Exception in thread main java.lang.NullPointerException
   at eu.emi.core.Client.main(Client.java:23)
 
  and
 
  WARNING: Unable to find a converter for this representation :
  [application/json,UTF-8]
  Exception in thread main java.lang.NullPointerException
   at eu.emi.core.Client.main(Client.java:23)
 
  respectively (its the same)!
 
  Strangely the first one with ...write(System.out) works fine.
 
  On the server side, the resource method is being called without any
  problems.
 
  Here is the resource class:
 
  @Path(/service)
  public class ServiceResourceImpl{
 
   /* (non-Javadoc)
* @see
 eu.emi.ServiceResource#getServiceDescription(java.lang.String)
*/
   @GET
   @Produces(MediaType.APPLICATION_JSON)
   public JSONObject getServiceDescription() {
   System.out.println(getting service description);
   MapString, String map = new HashMapString, String();
   map.put(id, 1);
   map.put(name, data);
 
   return new JSONObject(map);
   }
  }
 
  Could you please how can I resolve this?
 
  Thanks in advance,
  Daku
 
 
  CONFIDENTIALITY NOTICE: This e-mail and any files attached may contain
  confidential and proprietary information of Alcatel-Lucent and/or its
  affiliated entities. Access by the intended recipient only is
  authorized. Any liability arising from any party acting, or refraining
  from acting, on any information contained in this e-mail is hereby
  excluded. If you are not the intended recipient, please notify the
  sender immediately, destroy the original transmission and its
  attachments and do not disclose the contents to any other person, use it
  for any purpose, or store or copy the information in any medium.
  Copyright in this e-mail and any attachments belongs to Alcatel-Lucent
  and/or its affiliated entities.
 
 
  CONFIDENTIALITY NOTICE: This e-mail and any files attached may contain
  confidential and proprietary information of Alcatel-Lucent and/or its
  affiliated entities. Access by the intended recipient only is
  authorized. Any liability arising from any party acting, or refraining
  from acting, on any information contained in this e-mail is hereby
  excluded. If you are not the intended recipient, please notify the
  sender immediately, destroy the original transmission and its
  attachments and do not disclose the contents to any other person, use it
  for any purpose, or store or copy the information in any medium.
  Copyright in this e-mail and any attachments belongs to Alcatel-Lucent
  and/or its affiliated entities.


 --
 Laurent Rustuel,
 Alten contractor for Genesys, an Alcatel-Lucent Company

 --

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


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