3 Replies Latest reply on Nov 26, 2008 5:16 PM by olivier Fresse

    Seam GWT example not working

    Feroza Ahmad Newbie

      When I run the seam/remoting/gwt example in hosted mode, I get the following error when I click on the Ask button - Cannot find resource 'seam/resource/gwt' in the public path of module 'org.jboss.seam.example.remoting.gwt.HelloWorld'

      I havent made any changes to the example. What do I need to modify to get it to work?

      Any help would be appreciated.

      Seam version jboss-seam-2.0.2.SP1


        • 1. Re: Seam GWT example not working
          Feroza Ahmad Newbie

          Sorry forgot to mention that GWT is version  mac 1.5.2


          • 2. Re: Seam GWT example not working
            Dan Allen Master

            Technically we have never claimed to support hosted mode for this example. The readme.txt file advises you to check the GWT docs. If you happen to get it worked, please share the instructions by filing a JIRA or creating a knowledgebase page. Thanks!

            • 3. Re: Seam GWT example not working
              olivier Fresse Newbie

              It works for me :-)

              I had some issue wich looks like yours, though.

              To call the service, I had to change the code to get the good URL.

              Instead of
              I had

              GWT.getModuleBaseURL() returns http://localhost:8080/seampagination/gwt/seampagination.gwt.catalog.ManageCatalog...

              So I changed the code to retrieve the service interface :

              private CatalogServiceAsync getService() {
                      String endpointURL = GWT.getHostPageBaseURL() + "seam/resource/gwt";
                      CatalogServiceAsync svc = (CatalogServiceAsync) GWT.create(CatalogService.class);
                      //endpointURL = "http://localhost:8080/seampagination/seam/resource/gwt/seampagination.gwt.catalog.ManageCatalog/";
                      ((ServiceDefTarget) svc).setServiceEntryPoint(endpointURL);
                      Log.debug("GWT.getModuleBaseURL()   = " + GWT.getModuleBaseURL());
                      Log.debug("GWT.getHostPageBaseURL() = "+GWT.getHostPageBaseURL());
                      Log.debug("endpointURL              = " + endpointURL);
                      Log.debug("svc                      = " + svc);
                      return svc;

              Using getHostPageBaseURL() did the trick for me.

              Next, for the Hosted mode.

              First, I deploy my application. It's an EAR, with a WAR and an EJB. The GWT Service client and server code is in the WAR.
              The server code is a seam component, as described in the seam remote documentation.

              Then,  I use the following command :

              java  -Xmx256M -cp "$APPDIR/src/java:$APPDIR/web:$APPDIR/lib/gwt-log-2.5.3.jar:/home/ofe/dev/gwt-linux-1.5.3/gwt-user.jar:/home/ofe/dev/gwt-linux-1.5.3/gwt-dev-linux.jar" com.google.gwt.dev.GWTShell -out "$APPDIR/web" "$@" http://localhost:8080/seampagination/welcomeGWT.html

              And it works fine.
              Any change in the GWT modules code is taken into account.
              Of course, a change in the server code means a redeployment....

              BTW, I use glassfish under Linux.