8 Replies Latest reply on Feb 9, 2010 11:35 AM by virgo47

    GWT trunk with seam remoting

    sandlee

      Hi,
      I'm using seam 2.2.0-SNAPSHOT and GWT. After an update from gwt 1.7.0 to gwt trunk the rpc-services stopped working.
      With firebug I detected following changes in the request:



      GWT 1.7


      5|0|9|http://localhost:8080/app/|2594AA6F8ACFB5FFC873F691152D8CC4|com.app.rpcservice.AccountService|login|com.app.service.RequestData|java.lang.String|com.app.service.RequestData/1989346888|user@mail.com|password|1|2|3|4|3|5|6|6|7|8|9|



      GWT 2.0-SNAPSHOT


      5|0|8|http://localhost:8080/app/|1654D9B0A3B9AD20B92747282FCC1038|com.app.rpcservice.AccountService|login|com.app.service.RequestData/1989346888|java.lang.String/2004016611|user@mail.com|password|1|2|3|4|3|5|6|6|5|7|8|



      The change at com.app.service.RequestData/1989346888 throws the following excecption in the AS:


      com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Parameter 0 of is of an unknown type 'ch.pomop.app.service.model.RequestData/1989346888'
           at org.jboss.seam.remoting.gwt.GWTService.RPC_decodeRequest(GWTService.java:426)
           at org.jboss.seam.remoting.gwt.GWTService.processCall(GWTService.java:203)
           at org.jboss.seam.remoting.gwt.GWTService$1.process(GWTService.java:120)
           at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
           at org.jboss.seam.remoting.gwt.GWTService.getResource(GWTService.java:105)
           at org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      --- skipped --
      Caused by: java.lang.ClassNotFoundException: com.app.service.RequestData/1989346888
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:247)
           at org.jboss.seam.remoting.gwt.GWTService.RPC_getClassFromSerializedName(GWTService.java:479)
           at org.jboss.seam.remoting.gwt.GWTService.RPC_decodeRequest(GWTService.java:422)
      


      should I report this to jira?


      best regards,


      Sand Lee

        • 1. Re: GWT trunk with seam remoting
          bytecodesbr

          I have same problem...


          you found solution?


          Thanks.

          • 2. Re: GWT trunk with seam remoting
            sandlee

            Daniel Menezes wrote on Oct 03, 2009 04:26:


            I have same problem...

            you found solution?

            Thanks.


            No, havent found the time (and the need) to fix it. But it's probably not so difficult to extend GWT14Service and overwrite the org.jboss.seam.remoting.gwt.gwtRemoteService-Component.


            Anyway, please vote for the bug in Jira

            • 3. Re: GWT trunk with seam remoting
              gena

              Hello,


              I've got it working by replacing the line 479 of GWTService.java

              return Class.forName(serializedName, false, classLoader);


              with following snippet


               String serializedNameGWT2 =  serializedName;
                    if(serializedNameGWT2.contains("/"))
                       serializedNameGWT2 = serializedNameGWT2.substring(0, serializedNameGWT2.lastIndexOf("/"));
              
                    return Class.forName(serializedNameGWT2, false, classLoader);
              



              I didn't try it heavily, but some simple tests work fine.

              • 4. Re: GWT trunk with seam remoting
                larshuber

                Hi Gena


                did your fix work for GWT2? I mean did you use it in the last month? What's your result?


                Greets
                Lars

                • 5. Re: GWT trunk with seam remoting
                  larshuber

                  Hi Gena


                  did your fix work for GWT2? I mean did you use it in the last month? What's your result?


                  Greets
                  Lars

                  • 6. Re: GWT trunk with seam remoting
                    larshuber

                    I can confirm that the fix which Gena was mentioning above is working correctly. I've overridden the Built-In component and adapted the code (we have already done because of the serialization policy in development mode). I've also tested the new GWT 2.0 DirectEval RPC with Seam. This forced me again to create a new GWT Service component. This one works perfectly for developing because its much faster on client side in development mode. For productional purposes I think its not a solution (except Intranet applications). Deserializing on client side is faster but the payload is in my tests about three times bigger. Therefore we use deRPC for development and the common RPC for production. A fruther advantage of deRPC is the not needed serialization policy in development mode.

                    • 7. Re: GWT trunk with seam remoting
                      larshuber

                      Additional note to GWT Service:


                      Probabely it is possible to write the GWT Service in a different manner. Currently it is copied from GWT code and many methods are taken as private static method. This makes it hard to override. It forces the developer to copy again almost all of the code. I don't know if the static methods are due to performance - if not...please write overridable methods.

                      • 8. Re: GWT trunk with seam remoting
                        virgo47

                        We patched Seam's GWT Adapter and just copied the sources with little changes/additions and registered the new adapter to /gwt2 resource suffix.


                        Check this: http://virgo47.wordpress.com/2010/02/09/jboss-seam-gwt-2-support/
                        ZIP that is usable in a few minutes is included. We're not sure we made all changes necessary for GWT2, but it works for us for now.


                        It seems to be overkill to put this into your sources - but good thing is that no real patch to Seam is done. ;-) I agree with Lars that the whole Service has too many copy/pasted methods from GWT. There might be some intention behind it, but we couldn't see it.