Restlet GWT RPC 2.0

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Restlet GWT RPC 2.0

webpost
I am currently trying to build an application using the 2.0 M6 version of Restlet.

Ideally, I would like to use the GWT edition to consume resources on a J2EE edition server. Both are running v2 M6.

The problem I can't seem to solve is that of the remote RPC mechanism, I get a null pointer exception when trying to call the service using the code attached.

I'm trying to follow the GWT example that was posted on ongwt, but in that sample the GWT and RPC are in the same servlet context, in the case of my app, I need the GWT app on one context and the Rest service in a separate context. Is this possible, is this why it's not working?

Also when I compile the GWT app I get these error messsages, but it still compiles.

      [ERROR] Errors in 'jar:file:/home/kedaly/Libraries/restlet-gwt-2.0snapshot/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceInputStream.java'
         [ERROR] Line 42: No source code is available for type java.io.FilterInputStream; did you forget to inherit a required module?
         [ERROR] Line 59: The method write(int) is undefined for the type PrintStream
         [ERROR] Line 71: The method write(byte[], int, int) is undefined for the type PrintStream
         [ERROR] Line 84: The method write(byte[], int, int) is undefined for the type PrintStream
      [ERROR] Errors in 'jar:file:/home/kedaly/Libraries/restlet-gwt-2.0snapshot/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceOutputStream.java'
         [ERROR] Line 55: The method flush() of type TraceOutputStream must override or implement a supertype method
         [ERROR] Line 56: The method flush() is undefined for the type FilterOutputStream
         [ERROR] Line 59: The method flush() is undefined for the type PrintStream
         [ERROR] Line 64: The method write(int) of type TraceOutputStream must override or implement a supertype method
         [ERROR] Line 65: The method write(int) is undefined for the type FilterOutputStream
         [ERROR] Line 68: The method write(int) is undefined for the type PrintStream

Websitea.java (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Restlet GWT RPC 2.0

Kevin Daly
To give some more insight on the problem. When I run the code in the debugger the code fails on line 229 of ClientAdapter.java.

This line.

userCallback.handle(request, response);

I've looked at it in the debugger and there's no method to handle in the Proxy Class that I provided, the debugger also show that the class generated inherits from ClientResource, but I cannot find an implementation of handle(request, response) in ClientResource or UniformResource (parent class).

This seems to be where the problem is occurring. Is this a bug, or am I doing something wrong?

By the way, Restlet looks excellent and I am looking forward to using it in 2010. Happy New year to the Restlet Team.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433998
Reply | Threaded
Open this post in threaded view
|

RE: Restlet GWT RPC 2.0

Kevin Daly
In reply to this post by webpost
Here is the shell.output file for the project running in gwt hosted mode.

It seems to be failing at the eval statement.

Is this a bug, I would be happy to help fix it if it is. I just need some direction.

shell.output (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Restlet GWT RPC 2.0

jlouvel
Administrator
In reply to this post by Kevin Daly
Hi Kevin,

Happy new year! Quick reply:

1) I suggest that you have a look at this blog post:
http://blog.noelios.com/2009/12/17/restlet-a-restful-middleware-for-gwt-gae-
and-android/

2) Have a look at this tutorial:
http://wiki.restlet.org/docs_2.0/13-restlet/181-restlet/303-restlet.html

2) Please use a recent 2.0 snapshot to make the tutorial work:
http://www.restlet.org/downloads/unstable

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com



-----Message d'origine-----
De : Kevin Daly [mailto:[hidden email]]
Envoyé : jeudi 31 décembre 2009 17:35
À : [hidden email]
Objet : RE: Restlet GWT RPC 2.0

To give some more insight on the problem. When I run the code in the
debugger the code fails on line 229 of ClientAdapter.java.

This line.

userCallback.handle(request, response);

I've looked at it in the debugger and there's no method to handle in the
Proxy Class that I provided, the debugger also show that the class generated
inherits from ClientResource, but I cannot find an implementation of
handle(request, response) in ClientResource or UniformResource (parent
class).

This seems to be where the problem is occurring. Is this a bug, or am I
doing something wrong?

By the way, Restlet looks excellent and I am looking forward to using it in
2010. Happy New year to the Restlet Team.

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

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434068
Reply | Threaded
Open this post in threaded view
|

Restlet 2.0 & GWT 2.0 Dev Mode

BryanHunt
In reply to this post by Kevin Daly
I'm starting to look at using Restlet 2.0 with GWT 2.0.  The docs for setting up a project:

http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/186-restlet.html

talk about setting up the old GWT Hosted Mode.  The new Dev Mode seems to be using Jetty instead of Tomcat, and there doesn't seem to be any web.xml files for configuring the shell servlet.  Are there any new docs on how to set up a project using Restlet 2.0 with GWT 2.0 Dev Mode?

Bryan

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434081
Reply | Threaded
Open this post in threaded view
|

Re: Restlet 2.0 & GWT 2.0 Dev Mode

Rob Heittman
We should write some now that GWT 2.0 is not a moving target any more.  When working with Jetty and Dev Mode under 2.0 trunk, I have always just used the ServerServlet to attach Restlet to a path.  I do not believe it is really possible any more to attach Restlet to the root of the container (/), at least not without surgery to GWT's DefaultServlet, which in turn is a modified version of Jetty's that understands how to handle GWT modules ... and I hope we don't have to attack that.

All I do in practice, in my GWT 2.0 client applications, is make sure the root of any RESTful resources is configurable, and set it differently in Dev Mode than in production.  Then I usually attach Restlet (usually a redirector to my "real" Restlet server side running somewhere else) to /r under GWT using ServerServlet, same as any other JEE container.

If that practice sounds sane to everybody else, I'll write it up.

On Fri, Jan 1, 2010 at 9:56 AM, Bryan Hunt <[hidden email]> wrote:
I'm starting to look at using Restlet 2.0 with GWT 2.0.  The docs for setting up a project:

http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/186-restlet.html

talk about setting up the old GWT Hosted Mode.  The new Dev Mode seems to be using Jetty instead of Tomcat, and there doesn't seem to be any web.xml files for configuring the shell servlet.  Are there any new docs on how to set up a project using Restlet 2.0 with GWT 2.0 Dev Mode?

Bryan

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

Reply | Threaded
Open this post in threaded view
|

Re: Restlet 2.0 & GWT 2.0 Dev Mode

Tim Peierls
That answers the question I was trying to formulate, Rob. Yes, please do write it up.

The current Restlet-GWT sample project is already set up for Restlet 2.0 and GWT 2.0 -- I had no trouble getting things running in dev mode using Ant.

--tim

On Fri, Jan 1, 2010 at 10:18 AM, Rob Heittman <[hidden email]> wrote:
We should write some now that GWT 2.0 is not a moving target any more.  When working with Jetty and Dev Mode under 2.0 trunk, I have always just used the ServerServlet to attach Restlet to a path.  I do not believe it is really possible any more to attach Restlet to the root of the container (/), at least not without surgery to GWT's DefaultServlet, which in turn is a modified version of Jetty's that understands how to handle GWT modules ... and I hope we don't have to attack that.

All I do in practice, in my GWT 2.0 client applications, is make sure the root of any RESTful resources is configurable, and set it differently in Dev Mode than in production.  Then I usually attach Restlet (usually a redirector to my "real" Restlet server side running somewhere else) to /r under GWT using ServerServlet, same as any other JEE container.

If that practice sounds sane to everybody else, I'll write it up.

On Fri, Jan 1, 2010 at 9:56 AM, Bryan Hunt <[hidden email]> wrote:
I'm starting to look at using Restlet 2.0 with GWT 2.0.  The docs for setting up a project:

http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/186-restlet.html

talk about setting up the old GWT Hosted Mode.  The new Dev Mode seems to be using Jetty instead of Tomcat, and there doesn't seem to be any web.xml files for configuring the shell servlet.  Are there any new docs on how to set up a project using Restlet 2.0 with GWT 2.0 Dev Mode?

Bryan

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


Reply | Threaded
Open this post in threaded view
|

Re: Restlet 2.0 & GWT 2.0 Dev Mode

BryanHunt
In reply to this post by Rob Heittman
Rob,

How are you registering the ServerServlet with the embedded Jetty that GWT is launching?

Bryan

On Jan 1, 2010, at 9:18 AM, Rob Heittman wrote:

We should write some now that GWT 2.0 is not a moving target any more.  When working with Jetty and Dev Mode under 2.0 trunk, I have always just used the ServerServlet to attach Restlet to a path.  I do not believe it is really possible any more to attach Restlet to the root of the container (/), at least not without surgery to GWT's DefaultServlet, which in turn is a modified version of Jetty's that understands how to handle GWT modules ... and I hope we don't have to attack that.

All I do in practice, in my GWT 2.0 client applications, is make sure the root of any RESTful resources is configurable, and set it differently in Dev Mode than in production.  Then I usually attach Restlet (usually a redirector to my "real" Restlet server side running somewhere else) to /r under GWT using ServerServlet, same as any other JEE container.

If that practice sounds sane to everybody else, I'll write it up.

On Fri, Jan 1, 2010 at 9:56 AM, Bryan Hunt <[hidden email]> wrote:
I'm starting to look at using Restlet 2.0 with GWT 2.0.  The docs for setting up a project:

http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/186-restlet.html

talk about setting up the old GWT Hosted Mode.  The new Dev Mode seems to be using Jetty instead of Tomcat, and there doesn't seem to be any web.xml files for configuring the shell servlet.  Are there any new docs on how to set up a project using Restlet 2.0 with GWT 2.0 Dev Mode?

Bryan

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


Reply | Threaded
Open this post in threaded view
|

Re: Restlet 2.0 & GWT 2.0 Dev Mode

Rob Heittman
I use Eclipse and OSGi manifests, so the Restlet bundles are open in my IDE and declared as dependencies of my GWT project -- I need org.restlet and org.restlet.ext.servlet.  But however you get the jars onto the classpath will be fine -- I'll document a few other choices when I write this up officially.  Then in the war directory of my GWT project, I place a WEB-INF/lib/web.xml with contents like this:

<?xml version="1.0" encoding="UTF-8"?>
<web-app>

<servlet>
<servlet-name>adapter</servlet-name>
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
<init-param> <!--  In my case I have a dummy value here, as my component takes care of application attachment ... but see the ServerServlet docs-->
 <param-name>org.restlet.application</param-name>
 <param-value>org.restlet.Application [or your actual Application]</param-value>
</init-param>
<init-param>
 <param-name>org.restlet.component</param-name>
 <param-value>[my component here]</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>adapter</servlet-name>
<url-pattern>/r/*</url-pattern>
</servlet-mapping>

</web-app>


On Fri, Jan 1, 2010 at 12:16 PM, Bryan Hunt <[hidden email]> wrote:
Rob,

How are you registering the ServerServlet with the embedded Jetty that GWT is launching?

Bryan

On Jan 1, 2010, at 9:18 AM, Rob Heittman wrote:

We should write some now that GWT 2.0 is not a moving target any more.  When working with Jetty and Dev Mode under 2.0 trunk, I have always just used the ServerServlet to attach Restlet to a path.  I do not believe it is really possible any more to attach Restlet to the root of the container (/), at least not without surgery to GWT's DefaultServlet, which in turn is a modified version of Jetty's that understands how to handle GWT modules ... and I hope we don't have to attack that.

All I do in practice, in my GWT 2.0 client applications, is make sure the root of any RESTful resources is configurable, and set it differently in Dev Mode than in production.  Then I usually attach Restlet (usually a redirector to my "real" Restlet server side running somewhere else) to /r under GWT using ServerServlet, same as any other JEE container.

If that practice sounds sane to everybody else, I'll write it up.

On Fri, Jan 1, 2010 at 9:56 AM, Bryan Hunt <[hidden email]> wrote:
I'm starting to look at using Restlet 2.0 with GWT 2.0.  The docs for setting up a project:

http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/186-restlet.html

talk about setting up the old GWT Hosted Mode.  The new Dev Mode seems to be using Jetty instead of Tomcat, and there doesn't seem to be any web.xml files for configuring the shell servlet.  Are there any new docs on how to set up a project using Restlet 2.0 with GWT 2.0 Dev Mode?

Bryan

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



Reply | Threaded
Open this post in threaded view
|

RE: Restlet GWT RPC 2.0

webpost
In reply to this post by jlouvel
Thanks for your response.

I've used the latest build and I still have the same problem.

So here's what I have found, the code fails in JavaScript with this call.

eval("{\"ca.sqm.gwt.client.tabs.websitea.TestCase\":{\"firstName\":\"Daly\",\"lastName\":\"Kevin\",\"age\":41}}")

If I try to run this code in firebug on the command line it fails. What is needed to run it is a "(" at the start and a ")" at the end of the string, then the eval works.

Where is this eval generated, is it something that GWT builds or is there a generator registered in the Resteasy client library.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434736
Reply | Threaded
Open this post in threaded view
|

Re: Restlet GWT RPC 2.0

jlouvel
Administrator
Hi,

The Javascript is generated by GWT directly, so it could be a GWT
issue, but we would first like to reproduce your issue. Could you
enter a bug report in our issue tracker and attach a simple project
reproducing the issue?
http://www.restlet.org/community/issues

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


2010/1/4  <[hidden email]>:

> Thanks for your response.
>
> I've used the latest build and I still have the same problem.
>
> So here's what I have found, the code fails in JavaScript with this call.
>
> eval("{\"ca.sqm.gwt.client.tabs.websitea.TestCase\":{\"firstName\":\"Daly\",\"lastName\":\"Kevin\",\"age\":41}}")
>
> If I try to run this code in firebug on the command line it fails. What is needed to run it is a "(" at the start and a ")" at the end of the string, then the eval works.
>
> Where is this eval generated, is it something that GWT builds or is there a generator registered in the Resteasy client library.
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434736
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2435033
Reply | Threaded
Open this post in threaded view
|

Re: Restlet GWT RPC 2.0

Valdis Rigdon
I'm puttting together a sample project too, but I'm hitting the same
issues using the snapshot downloaded from today (Jan 06, 2010).

I've basically done nothing much more than create a default GWT web
application from the GWT Eclipse wizard and then start moving in the
pieces from the serialization example from the wiki.

[ERROR] Errors in
'jar:file:/home/vrigdon/lib/restlet-gwt-2.0snapshot-01-06-10/lib/org.restlet.jar!/org/restlet/client/util/ServiceList.java'
         [ERROR] Line 66: The method
isAssignableFrom(Class<capture#1-of ? extends Service>) is undefined
for the type Class<T>
         [ERROR] Line 104: The method
isAssignableFrom(Class<capture#3-of ? extends Service>) is undefined
for the type Class<capture#2-of ? extends Service>
      [ERROR] Errors in
'jar:file:/home/vrigdon/lib/restlet-gwt-2.0snapshot-01-06-10/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceInputStream.java'
         [ERROR] Line 42: No source code is available for type
java.io.FilterInputStream; did you forget to inherit a required
module?
         [ERROR] Line 59: The method write(int) is undefined for the
type PrintStream
         [ERROR] Line 71: The method write(byte[], int, int) is
undefined for the type PrintStream
         [ERROR] Line 84: The method write(byte[], int, int) is
undefined for the type PrintStream
      [ERROR] Errors in
'jar:file:/home/vrigdon/lib/restlet-gwt-2.0snapshot-01-06-10/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceOutputStream.java'
         [ERROR] Line 55: The method flush() of type TraceOutputStream
must override or implement a supertype method
         [ERROR] Line 56: The method flush() is undefined for the type
FilterOutputStream
         [ERROR] Line 59: The method flush() is undefined for the type
PrintStream
         [ERROR] Line 64: The method write(int) of type
TraceOutputStream must override or implement a supertype method
         [ERROR] Line 65: The method write(int) is undefined for the
type FilterOutputStream
         [ERROR] Line 68: The method write(int) is undefined for the
type PrintStream



On Tue, Jan 5, 2010 at 5:39 PM, Jerome Louvel <[hidden email]> wrote:

> Hi,
>
> The Javascript is generated by GWT directly, so it could be a GWT
> issue, but we would first like to reproduce your issue. Could you
> enter a bug report in our issue tracker and attach a simple project
> reproducing the issue?
> http://www.restlet.org/community/issues
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
> 2010/1/4  <[hidden email]>:
>> Thanks for your response.
>>
>> I've used the latest build and I still have the same problem.
>>
>> So here's what I have found, the code fails in JavaScript with this call.
>>
>> eval("{\"ca.sqm.gwt.client.tabs.websitea.TestCase\":{\"firstName\":\"Daly\",\"lastName\":\"Kevin\",\"age\":41}}")
>>
>> If I try to run this code in firebug on the command line it fails. What is needed to run it is a "(" at the start and a ")" at the end of the string, then the eval works.
>>
>> Where is this eval generated, is it something that GWT builds or is there a generator registered in the Resteasy client library.
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434736
>>
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2435033
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2435246
Reply | Threaded
Open this post in threaded view
|

Re: Restlet GWT RPC 2.0

Valdis Rigdon
As a follow up, something between the Dec 17th build and the Jan 6
build has broken the GWT version.  I have the same project using the
JARs from the serialization example
(http://wiki.restlet.org/docs_2.0/13-restlet/181-restlet/303-restlet.html)
in Eclipse and the project will compile via GWT.  If I remove those
libraries and replace them with latest snapshot from Jan 06, add in
the inherits for XML and JSON, then it breaks with the errors below.

Any ideas?

On Wed, Jan 6, 2010 at 2:02 PM, Valdis Rigdon <[hidden email]> wrote:

> I'm puttting together a sample project too, but I'm hitting the same
> issues using the snapshot downloaded from today (Jan 06, 2010).
>
> I've basically done nothing much more than create a default GWT web
> application from the GWT Eclipse wizard and then start moving in the
> pieces from the serialization example from the wiki.
>
> [ERROR] Errors in
> 'jar:file:/home/vrigdon/lib/restlet-gwt-2.0snapshot-01-06-10/lib/org.restlet.jar!/org/restlet/client/util/ServiceList.java'
>         [ERROR] Line 66: The method
> isAssignableFrom(Class<capture#1-of ? extends Service>) is undefined
> for the type Class<T>
>         [ERROR] Line 104: The method
> isAssignableFrom(Class<capture#3-of ? extends Service>) is undefined
> for the type Class<capture#2-of ? extends Service>
>      [ERROR] Errors in
> 'jar:file:/home/vrigdon/lib/restlet-gwt-2.0snapshot-01-06-10/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceInputStream.java'
>         [ERROR] Line 42: No source code is available for type
> java.io.FilterInputStream; did you forget to inherit a required
> module?
>         [ERROR] Line 59: The method write(int) is undefined for the
> type PrintStream
>         [ERROR] Line 71: The method write(byte[], int, int) is
> undefined for the type PrintStream
>         [ERROR] Line 84: The method write(byte[], int, int) is
> undefined for the type PrintStream
>      [ERROR] Errors in
> 'jar:file:/home/vrigdon/lib/restlet-gwt-2.0snapshot-01-06-10/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceOutputStream.java'
>         [ERROR] Line 55: The method flush() of type TraceOutputStream
> must override or implement a supertype method
>         [ERROR] Line 56: The method flush() is undefined for the type
> FilterOutputStream
>         [ERROR] Line 59: The method flush() is undefined for the type
> PrintStream
>         [ERROR] Line 64: The method write(int) of type
> TraceOutputStream must override or implement a supertype method
>         [ERROR] Line 65: The method write(int) is undefined for the
> type FilterOutputStream
>         [ERROR] Line 68: The method write(int) is undefined for the
> type PrintStream
>
>
>
> On Tue, Jan 5, 2010 at 5:39 PM, Jerome Louvel <[hidden email]> wrote:
>> Hi,
>>
>> The Javascript is generated by GWT directly, so it could be a GWT
>> issue, but we would first like to reproduce your issue. Could you
>> enter a bug report in our issue tracker and attach a simple project
>> reproducing the issue?
>> http://www.restlet.org/community/issues
>>
>> Best regards,
>> Jerome Louvel
>> --
>> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
>> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>>
>>
>> 2010/1/4  <[hidden email]>:
>>> Thanks for your response.
>>>
>>> I've used the latest build and I still have the same problem.
>>>
>>> So here's what I have found, the code fails in JavaScript with this call.
>>>
>>> eval("{\"ca.sqm.gwt.client.tabs.websitea.TestCase\":{\"firstName\":\"Daly\",\"lastName\":\"Kevin\",\"age\":41}}")
>>>
>>> If I try to run this code in firebug on the command line it fails. What is needed to run it is a "(" at the start and a ")" at the end of the string, then the eval works.
>>>
>>> Where is this eval generated, is it something that GWT builds or is there a generator registered in the Resteasy client library.
>>>
>>> ------------------------------------------------------
>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434736
>>>
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2435033
>>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2435478
Reply | Threaded
Open this post in threaded view
|

RE: Re: Restlet GWT RPC 2.0 ** SOLVED **

Kevin Daly
In reply to this post by jlouvel
I got it working, the issue was dependencies.

I needed to include the gwt extension in classpath of my Servlet Based application. I also needed to add the GWT 2.0 libraries to the Servlet app.

I will write up a document with examples so that anyone else that has this problem can fix it.

I would also like to suggest throwing an error when a certain type is requested in the http header and the Restlet framework does not have a converter for it.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2435507
Reply | Threaded
Open this post in threaded view
|

Re: Restlet GWT RPC 2.0

Niclas Hedhman
In reply to this post by webpost
Is there any conclusion on this topic?

I have also needed to move from M6 to SNAPSHOT (and to GWT 2.0) for
other reasons, and somewhere along the line this appeared. My guess is
that the error message is clear cut, FilterInputStream is not
available in the Emulation module (anymore?) and that the methods
mentioned are in fact missing in the emulation module...

Cheers


On Thu, Dec 31, 2009 at 10:08 PM,  <[hidden email]> wrote:

> I am currently trying to build an application using the 2.0 M6 version of Restlet.
>
> Ideally, I would like to use the GWT edition to consume resources on a J2EE edition server. Both are running v2 M6.
>
> The problem I can't seem to solve is that of the remote RPC mechanism, I get a null pointer exception when trying to call the service using the code attached.
>
> I'm trying to follow the GWT example that was posted on ongwt, but in that sample the GWT and RPC are in the same servlet context, in the case of my app, I need the GWT app on one context and the Rest service in a separate context. Is this possible, is this why it's not working?
>
> Also when I compile the GWT app I get these error messsages, but it still compiles.
>
>      [ERROR] Errors in 'jar:file:/home/kedaly/Libraries/restlet-gwt-2.0snapshot/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceInputStream.java'
>         [ERROR] Line 42: No source code is available for type java.io.FilterInputStream; did you forget to inherit a required module?
>         [ERROR] Line 59: The method write(int) is undefined for the type PrintStream
>         [ERROR] Line 71: The method write(byte[], int, int) is undefined for the type PrintStream
>         [ERROR] Line 84: The method write(byte[], int, int) is undefined for the type PrintStream
>      [ERROR] Errors in 'jar:file:/home/kedaly/Libraries/restlet-gwt-2.0snapshot/lib/org.restlet.jar!/org/restlet/client/engine/io/TraceOutputStream.java'
>         [ERROR] Line 55: The method flush() of type TraceOutputStream must override or implement a supertype method
>         [ERROR] Line 56: The method flush() is undefined for the type FilterOutputStream
>         [ERROR] Line 59: The method flush() is undefined for the type PrintStream
>         [ERROR] Line 64: The method write(int) of type TraceOutputStream must override or implement a supertype method
>         [ERROR] Line 65: The method write(int) is undefined for the type FilterOutputStream
>         [ERROR] Line 68: The method write(int) is undefined for the type PrintStream



--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2436929
Reply | Threaded
Open this post in threaded view
|

RE: Re: Restlet GWT RPC 2.0

Kevin Daly
It's now compiling for me. The errors don't seem to cause any issues. I guess it will all be worked out in the next milestone.

see this post in the bug tracker.

http://restlet.tigris.org/issues/show_bug.cgi?id=1004

My last post is how I got it all working.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437013
Reply | Threaded
Open this post in threaded view
|

Re: Re: Restlet GWT RPC 2.0

Tim Peierls
It's still pretty annoying to have to drag in servlets. Is it really too hard to extract the important parts of GwtShellServlet into a Restlet?

--tim

On Wed, Jan 13, 2010 at 8:46 AM, Kevin Daly <[hidden email]> wrote:
It's now compiling for me. The errors don't seem to cause any issues. I guess it will all be worked out in the next milestone.

see this post in the bug tracker.

http://restlet.tigris.org/issues/show_bug.cgi?id=1004

My last post is how I got it all working.

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

Reply | Threaded
Open this post in threaded view
|

Re: Re: Restlet GWT RPC 2.0

Niclas Hedhman
In reply to this post by Kevin Daly
On Wed, Jan 13, 2010 at 9:46 PM, Kevin Daly <[hidden email]> wrote:
> It's now compiling for me. The errors don't seem to cause any issues. I guess it will all be worked out in the next milestone.
>
> see this post in the bug tracker.
>
> http://restlet.tigris.org/issues/show_bug.cgi?id=1004

Not sure if we are observing the same problem.

I have all the while had the GWT served from one webapp (.war) and the
Restlet based server in a different webapp. All the while the GWT
edition of org.restlet (and servlet) has been separated from the JEE
edition during compile, so I don't think it is related. (Or do I
misunderstand your explaination?)

I have worked off the HEAD for a while, but can't pinpoint the time of
breakage, whether it was something that changed in Restlet, my
introduction of GWT 2.0 OR some statement that I have added that
triggers the problem. After all, doesn't GWT only traverse the usage
graphs of classes when it decides what to be pulled in?


I'll see if I can pull together a really tiny testcase...

Cheers
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437053
Reply | Threaded
Open this post in threaded view
|

Re: Re: Restlet GWT RPC 2.0

Niclas Hedhman
And suddenly a new one showed up (I don't use ServiceList AFAIK);

[INFO]       [ERROR] Errors in
'jar:file:/Users/niclas/.m2/repository/org/restlet/gwt/org.restlet/2.0-SNAPSHOT/org.restlet-2.0-SNAPSHOT.jar!/org/restlet/client/util/ServiceList.java'
[INFO]          [ERROR] Line 66: The method
isAssignableFrom(Class<capture#1-of ? extends Service>) is undefined
for the type Class<T>
[INFO]          [ERROR] Line 104: The method
isAssignableFrom(Class<capture#3-of ? extends Service>) is undefined
for the type Class<capture#2-of ? extends Service>


Apparently, the code that ends up inside the GWT module is not fully
GWT compatible, which may be a sideeffect from trying to re-use too
much code.


Cheers

On Wed, Jan 13, 2010 at 11:50 PM, Niclas Hedhman <[hidden email]> wrote:

> On Wed, Jan 13, 2010 at 9:46 PM, Kevin Daly <[hidden email]> wrote:
>> It's now compiling for me. The errors don't seem to cause any issues. I guess it will all be worked out in the next milestone.
>>
>> see this post in the bug tracker.
>>
>> http://restlet.tigris.org/issues/show_bug.cgi?id=1004
>
> Not sure if we are observing the same problem.
>
> I have all the while had the GWT served from one webapp (.war) and the
> Restlet based server in a different webapp. All the while the GWT
> edition of org.restlet (and servlet) has been separated from the JEE
> edition during compile, so I don't think it is related. (Or do I
> misunderstand your explaination?)
>
> I have worked off the HEAD for a while, but can't pinpoint the time of
> breakage, whether it was something that changed in Restlet, my
> introduction of GWT 2.0 OR some statement that I have added that
> triggers the problem. After all, doesn't GWT only traverse the usage
> graphs of classes when it decides what to be pulled in?
>
>
> I'll see if I can pull together a really tiny testcase...
>
> Cheers
> --
> Niclas Hedhman, Software Developer
> http://www.qi4j.org - New Energy for Java
>
> I  live here; http://tinyurl.com/2qq9er
> I  work here; http://tinyurl.com/2ymelc
> I relax here; http://tinyurl.com/2cgsug
>



--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2437598
Reply | Threaded
Open this post in threaded view
|

Problems with ServerServlet and Equinox servletbridge

BryanHunt
In reply to this post by Rob Heittman
I managed to get ServerServlet working with the Equinox servletbridge in Tomcat, but it was not without problems.  I finally tracked the problem down to the MANIFEST.MF in org.restlet.ext.servlet.  When the servletbridge is deployed, the javax.servlet bundle is deployed as well for convienence.  The servletbridge exports the javax.servlet package from Tomcat and effectively ignores the javax.servlet bundle.  The "uses:" clause in org.restlet.ext.servlet appears to force that bundle to bind to the javax.servlet package from the deployed javax.servlet bundle instead of the javax.servlet package from Tomcat.  The result is a ClassCastException when the servletbridge tries to cast ServerServlet to Servlet.  Removing the "uses:" clause from the MANIFEST.MF fixes the problem.  Is there any reason the "uses:" clause is required?

Bryan

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