On Thu, Mar 26, 2009 at 10:22 AM, [email protected] <[email protected]> wrote:
> I'm trying to do what's stated in the subject.  I thought I could use
> javaongems to do that with the following code :
>
> -----------------------------
> import org.javaongems.core.jclient.Gwt;
> import com.google.gwt.user.client.rpc.ServiceDefTarget;
>
> public class JavaRpcClient {
>                static public void main(String[] args) throws Exception {
>                Object myService = Gwt.create(my.package.MyService.class);
>                ((ServiceDefTarget) rpc).setServiceEntryPoint("http://
> service-url.com");
>
>                [...]
>
>        }
> }
> -----------------------------
>
> However when I try and run this code, I get :
>
> Exception in thread "main" java.lang.NoClassDefFoundError: com/google/
> gwt/user/server/rpc/impl/ServerSerializableTypeOracle
>        at org.javaongems.core.jclient.Gwt.create(Gwt.java:29)
>        at
> org.bioversityinternational.webmgis.server.rpcclient.JavaRpcClient.main
> (JavaRpcClient.java:14)
>
> My guess is, ServerSerializableTypeOracle is an old class which is not
> any more distributed with GWT (the javaongems jar I found is almost
> 2.5 years old).  Well all this makes sense, but now my question is, is
> there an alternative?

You may want to search the archives of this list for some keywoards
relevant to what you're trying to do.  Every now and then someone
asks, and the answer is always "you can't get there from here".

GWT's RPC wire format is optimized for web-browser to web-server
communication.  There are all kinds of implementation details that
assume the client is GWT-compiled Javascript.  Hosted mode is
Java-on-a-JVM, so it's obviously possible to do what you're trying to
do, but the overhead is not worth it for "real" Java applications
(you'd have to either run hosted mode or re-implement the client-side
RPC goo).

You need to refactor your server to be able to handle "the same"
request from two or more different kinds of clients and funnel all the
requests through the same business logic.  Complicating your clients
by making them speak GWT RPC is the path to insanity.

Ian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to