Announcement Announcement Module
Collapse
No announcement yet.
Roo+GWT Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo+GWT

    Hello

    I am using STS 2.8.0 with GWT (not sure as it was setup with web gwt setup). I was trying to do roo+gwt sample project. everything was fine while creating the project. I setup hibernate persistence to mysql. sts attached and reverse engineered my db and created a number of domain objects. So far so good. then I did web gwt setup and it created all the scafolding. When I try to run the application, it shows that the application is deployed on tcServer and in sync, but the web browser just shows "loading" and I don't see any UI or navigation what so ever.

    what step did I miss?

    Alex

  • #2
    Hey Alex,

    What browser are you using? Have you downloaded the GWT browser plugin? Are you running using the mvn gwt:run command or from Eclipse? Have you looked at your console?

    Also, it may be not your case (and very dumb) but sometimes it takes several seconds to load. It happened to me that I closed the browser before the server launches the application.


    David
    Last edited by papirrin; Nov 4th, 2011, 02:53 PM.

    Comment


    • #3
      David,

      thanks for your help. First, just a bit more information that I missed in the first email. i am using Roo 1.1.5 (Current GA). I tried using both Safari and Firefox and both demonstrated the same problem. I believe it because ApplicationScaffold.html below that is being used

      <!doctype html>
      <html>
      <head>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <meta name="viewport" content="width=device-width">
      <title>Data Browser</title>
      <script type="text/javascript" language="javascript" src="applicationScaffold/applicationScaffold.nocache.js"></script>
      </head>
      <body style="-webkit-text-size-adjust: none;">
      <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0 "></iframe>
      <span id='loading' style="margin-left:10px;font-size:12px;padding:10px;font-family:Helvetica;background-color:#e5edf9;border:2px solid #96a2b5;">
      loading…
      </span>
      </body>
      </html>

      is referring to a file that does not exist: applicationScaffold/applicationScaffold.nocache.js

      in fact i do not have any .js file in the project structure which i find interesting as I it supposed to be using GWT for UI.

      I saw other mentioned gwt:run. I am not sure i know what that is or how to do it. If I right-click on the project the only Run option i have is to run the project on the server. the other options are maven related. please explain what is gwt:run.

      Yesterday, I did not have GWT plugin/extension installed in STS. I thought that could have been an issue. Today, i installed that extension and built new project but with the same results.

      Alex

      Comment


      • #4
        Hi Alex,

        You definitively need the GWT extension. If correctly installed, you can left click in the project folder -> Run As -> Web Application. This will launch your jetty server in developer mode and will print a link to launch your browser in the Developer Mode tab.

        The applicationScaffold/applicationScaffold.nocache.js should be created in your project output.

        When I wrote "gwt:run" I meant "mvn gwt:run". This is a Maven command that you can use to run without eclipse, as explained in the gwt guide for Roo:

        http://code.google.com/webtoolkit/do...sts.html#maven

        Hope it helps!

        David

        Comment


        • #5
          David,

          When i wrote I installed GWT extension, I meant Eclipse plug-in. Are you saying that I need to install gwt, maven, roo outside of eclipse?

          When I right-click, I get an option to run on tcServer as this is the built-in STS server. I don't have full blown tomcat running on my system as I am still running in development mode.

          I guess I am missing an important step someplace as .js scaffold files are not generated or located. I am wondering what I missed. Were you able to build a sample of roo+gwt. if so, can you send me your roo.log file so I can see the commands you typed in the roo shell?

          Alex

          Comment


          • #6
            Installing GWT and Spring Roo

            Ok, the way to go is:
            • Install STS. It will come with Maven, Spring roo and Spring core.
            • nstall the GWT extension for STS.

            A detailed guide is in here:

            http://code.google.com/webtoolkit/do...l/roo-sts.html

            A quick note, if you use the last stable release of STS, you will get a bunch of warnings because it uses GWT 2.1 and the current GWT version is 2.4. You can either ignore the warnings (most of them are because there was a package refactory in GWT to accomodate for Android development. These are changes only in the layout of the package, not in its functionality or API) or you can download Roo 1.2.0.M1 (if you download it, place in in your springsource folder, next to the 1.1.5 Spring Roo -or instead of it- and update its reference into STS -Right click on Project -> Properties -> Spring -> Spring Roo -> Set the Roo 1.2.0.M1 folder path-). If you do the second one, you will get some errors when the Maven project is imported into Eclipse, to solve them do the following:
            1. Add the GWT library to the project (Right click on Project -> Properties -> Java Build Path -> Library -> Add Library -> Google Web Toolkit) .
            2. Add the item detailed in this post to the pom file.

            Let me know if this worked out for you of if you need more detailed information.

            David

            Comment


            • #7
              David,

              ok. now we are getting somewhere. I tried running the project under maven and it worked in the development mode under jetty. Unless I am missing something, I should be able to do 2 things:

              1. Able to view and change scaffolded pages generated for my model classes.
              2. Launch Roo+GWT as a web application.

              I located scaffold classes (i think ), but the design tab never shows up in STS, so i can't change the design. Did you try changing the default scaffold UI?

              2. When i compile GWT application and then launch as a web application, I am back to square 1. It seems like it is launching ScaffoldApplication.html, but I am getting no further then before. Is it because I am trying to launch still in the development mode and I need to use Google Plugin in this mode? How do I change development mode to something else?

              Alex

              Comment


              • #8
                Hi Alex,

                This text:
                I should be able to do 2 things:

                1. Able to view and change scaffolded pages generated for my model classes.
                2. Launch Roo+GWT as a web application.

                I located scaffold classes (i think ), but the design tab never shows up in STS, so i can't change the design. Did you try changing the default scaffold UI?
                Makes me think that you are expecitng some sort of editor (maybe GWT Designer??) to be part of STS. It may be one source of confusion.

                GWT is not GWT Designer. GWT converts your Java code into Javasrcipt and contain some other Java classes to help you with some common tasks. The GWT designer is a different project. If you want to use it with your Roo generated project, then you should download it from its webpage, install it and open your project with it (I haven't try this, but I don't see a reason why it shouldn't work).

                About your question:

                Did you try changing the default scaffold UI?
                Yes, I did, but by changing the code (An easy way is modifying the ui.xml files that are in your project now).

                About:

                2. When i compile GWT application and then launch as a web application, I am back to square 1. It seems like it is launching ScaffoldApplication.html, but I am getting no further then before. Is it because I am trying to launch still in the development mode and I need to use Google Plugin in this mode? How do I change development mode to something else?
                The developer mode should work and you are using the Google Plugin while running in this mode. Pay attention to the Console Window in STS (Eclipse) to look for the reason why your application is not loaded (it will print information about your launch).

                Hope it helps.
                David

                Comment


                • #9
                  Good afternoon,

                  I'm running into an issue here which I suspect is related to the one mentioned above.

                  I recently installed latest version of STS (2.8.0.RELEASE), was asked to update to the new Maven integration stuff (you know, the one that breaks everything and you have to do a lot of dirty work to fix). I managed to get rid of the "lifecycle" error by following the advice provided on the forum (http://blog.springsource.org/2011/10...l-suite-2-8-0/), namely quickfixing the error in pom.xml, then changing "ignore" to "execute" in the fix.

                  All this leads me to a maven project which seems apparently fine, but a project in itself with a lot of "import cannot be resolved" errors, which, in turn, prevent me from going much further on the test server bench (GOOGLE APP ENGINE). When I hit "Debug as ..." then "Web application", then click on the provided address, I can login bit get stuck on "Loading ..." as described in the first message of this thread.

                  I strongly suspect that solving the "import cannot be resolved" errors (for example "[ERROR] [applicationScaffold] - Line 3: The import com.xxx.client.managed.request.ApplicationEntityTy pesProcessor cannot be resolved" or "[ERROR] [applicationScaffold] - Line 39: ApplicationMasterActivities cannot be resolved to a type") should lead me to the light at the end of the tunnel.

                  Can anyone here help ??

                  Thanks a lot

                  Comment


                  • #10
                    Same problem

                    I am going through the same issue, I'd appreciate if you share any progress. Regards

                    Comment


                    • #11
                      Good news : I found my way out !

                      All this "non resolved type" errors made me think I missed one jar. I investigated in my maven dependencies, and found the javax validation sources jar, not the javax validation jar. Whereas in the pom.xml both were referenced. So I simply copied and pasted the missing jar (validation-api-1.0.0.GA.jar, which I found in folder [user folder]\.m2\repository\javax\validation\validation-api\1.0.0.GA) to my target directory. Then I manually referenced it (right-click on the project name, Build Path, Add External Archives), and that was it. One last "Project", "Clean" for desert, and no more Java Errors in the way !

                      Hope this helps

                      Comment


                      • #12
                        Thanks

                        Thanks for the tip, i was trying the same thing, but i though that maybe there was some other way. To work then!

                        Comment


                        • #13
                          About the lifecycle problem, an alternative solution is in here: http://forum.springsource.org/showth...ht=#post385963

                          that works in case that Eclipse doesn show you the quickfix option (was my case).

                          About the lots of import errors, in my case it was because the project didn include the GWT Library by default. (Right click on Project -> Properties -> Java Build Path -> Library -> Add Library -> Google Web Toolkit) .

                          Note: If the project has import error, then it is not being build, so the behaviour you are seeing is only what in comes in the html file, there is not GWT at all.

                          Let me know if the import errors are gone after adding the GWT library, if not, please provide me extra information about them.

                          Comment

                          Working...
                          X