3 Replies Latest reply on Dec 14, 2009 10:47 AM by Tomaz Cerar

    Seam + GWT 1.7?

    Markus Wilthaner Newbie

      Hello,


      I'm trying to connect a GWT frontend with Seam as described here (http://docs.jboss.org/seam/2.1.2/reference/en-US/html/gwt.html) using GWT 1.7.1.


      However, accessing the method I get:


      Exception while dispatching incoming RPC call java.lang.SecurityException: Unable to access a service method called \[greetServer\] on class \[server.gwt.GreetingServiceImpl\] without the @WebRemote attribut
      e. This may be a hack attempt, or someone simply neglected to use the @WebRemote attribute to indicate a method as remotely accessible.
      



      The method itself is annotated with @WebRemote. This is the message I get with Seam 2.1.2 CR2 when I'm including jboss-seam.jar, jboss-seam-remoting.jar from Seam and gwt-servlet.jar from GWT 1.7.1. Now if I use the gwt-servlet.jar that Seam provides, I get the following exception:


      Exception while dispatching incoming RPC call
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:617)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readInt(ServerSerializationStreamReader.java:432)
        at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.prepareToRead(AbstractSerializationStreamReader.java:38)
        at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:383)
        at org.jboss.seam.remoting.gwt.GWTService.processCall(GWTService.java:200)
      



      Which is probably due to the GWT application being developed in GWT 1.7.1, I guess.


      I finally tried with jboss-seam.jar, jboss-seam-remoting.jar from Seam 2.2.0 GA and the result is:


      ERROR An IncompatibleRemoteServiceException was thrown while processing this call.
      com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. ( Blocked attempt to access interface 'gwt.client.GreetingService', which doesn't extend RemoteService; this is either misconfiguration or a hack attempt )
              at org.jboss.seam.remoting.gwt.GWTService.RPC\_decodeRequest(GWTService.java:400)
      



      So is it not possible to use GWT 1.7.1 with Seam? Am I doing something wrong? Which version of GWT would work with Seam 2.1.2 CR2?


      Thanks a lot!

        • 1. Re: Seam + GWT 1.7?
          f.sauter Newbie

          Hi Markus!


          Did you find a solution? I have exactly the same problem (java.lang.IndexOutOfBoundsException).


          Used: Jboss:5.1.0.GA, seam: 2.2.0.GA, gwt: gwt-windows-1.7.1.


          Did it works for you with an older gwt version?

          • 2. Re: Seam + GWT 1.7?
            f.sauter Newbie

            I just compiled and deployed the original seam example (from 2.2.0.GA) with the version gwt-windows-1.7.1. That's the outcome here:


            15:47:54,844 ERROR [[/seam-gwt]] Exception while dispatching incoming RPC call
            java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
                 at java.util.ArrayList.RangeCheck(Unknown Source)
                 at java.util.ArrayList.get(Unknown Source)
                 at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:617)
                 at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readInt(ServerSerializationStreamReader.java:432)
                 at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.prepareToRead(AbstractSerializationStreamReader.java:38)
                 at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:383)
                 at org.jboss.seam.remoting.gwt.GWTService.RPC_decodeRequest(GWTService.java:376)
                 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:717)
                 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)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                 at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                 at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                 at java.lang.Thread.run(Unknown Source)
            



            So is there any patch or fix? What must I do to get the seam remoting gwt example to run with gwt 1.7? Thanks for help!

            • 3. Re: Seam + GWT 1.7?
              Tomaz Cerar Master

              Hi,


              I have seam 2.2.0.GA and gwt 1.7 and it works.
              As you have found out you have to use gwt-servlet.jar that comes with gwt 1.7 insteed of one that comes with seam. Using seam-remoting from latest seam can't hurt.
              Other than that it should work.




              the errror:




              Exception while dispatching incoming RPC call java.lang.SecurityException: Unable to access a service method called greetServer on class server.gwt.GreetingServiceImpl without the @WebRemote attribute. This may be a hack attempt, or someone simply neglected to use the @WebRemote attribute to indicate a method as remotely accessible.




              just means you didn't annotate method you are calling with @WebRemote annotation.
              annotation must be present on method in implementation class.



              cheers,


              tomaz