Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HowTo: Using SmartGWT with NetBeans and GWT4NB

    For those of you who use NetBeans with the GWT4NB, here are some helpful tips to get started with SmartGWT. This applies to Glassfish, I don't know how it configures for Tomcat.

    First when you try to run a SmartGWT application (as with ExtGWT) you will run out of java heap space when you try to compile. To fix this, modify build-gwt.xml as follows:

    In target "-post-compile", change:
    Code:
    <java classpath="${javac.classpath}:${src.dir}" failonerror="true"
         classname="com.google.gwt.dev.GWTCompiler" fork="true">
    to:
    Code:
    <java classpath="${javac.classpath}:${src.dir}" failonerror="true"
         classname="com.google.gwt.dev.GWTCompiler" fork="true" [b]maxmemory="512M"[/b]>
    and add the following child element to that same element:
    Code:
    <jvmarg value="-Xmx512M"/>
    There are also two places that you see
    Code:
    name="${gwtshell.jvmargs.base}" value="-Xdebug . . ."
    add -Xmx512M to that list of arguments.

    Now you will be able to run it, but none of the images in the SmartGWT.jar will show up. To get those working, look at your gwt.properties file and change
    Code:
    gwt.output.dir=/com.test.Main
    to
    Code:
    gwt.output.dir=./
    Look at the auto generated HTML file and make sure you change
    Code:
    <script language="javascript" src="com.test.Main/com.test.Main.nocache.js"></script>
    to
    Code:
    <script language="javascript" src="com.test.Main.nocache.js"></script>
    Everything should work perfectly. Note that the memory changes you made to build-gwt.xml will be overwritten each time you open NetBeans. There is a way to make the changes permanent, but you can google how to do that yourself.

    I hope this helps someone. It would have saved me a good bit of time!

    #2
    Thanks for posting that Marcus, that's very helpful.

    Comment


      #3
      It works like a charm. I tried it on tomcat

      Comment


        #4
        How to use SmartyGWT with NetBean and Maven

        SmartGWT can also be used with NetBeans and Maven. Here is how:

        -Install the Maven Plugin in Netbeans at Tools > Plugins > Available Plugins.
        -Use the GWT-Maven: Eclipse Maven 2 Plugin for the Google Web Toolkit in your pom

        Comment


          #5
          Version 2.5.2

          GWT4NB has been updated to 2.5.2 on https://gwt4nb.dev.java.net/. I don't see it in the available list from netbeans but you can download it then install via the "Downloaded" tab of the Plugins wizard.

          This has the memory fix and now supports types on the AsyncCallback

          Code:
          AsyncCallback<List<AlbumData>> callback = new AsyncCallback<List<AlbumData>>() {
          When using an existing project you will need to add this to your gwt.properties file:
          Code:
          gwt.compiler.jvmargs=-Xmx512m

          Comment


            #6
            Aaldaaf,
            Sweet, thanks for the update. Good to see the GWT4NB team hasn't disappeared, heard rumors that development had stopped and was afraid I'd have to start over with Maven or another library. I've already lost a significant amount of time dumping the learning curve of the "library that must not be named" and moving to SmartGWT.

            Comment


              #7
              I've been checking out GWT4NB and was quite disappointed by the handling of dependencies:
              For example why would I need gwt-dev-*.jar in my WAR file ? Have these issues been fixed ?

              Comment


                #8
                Originally posted by marcusocasey
                Now you will be able to run it, but none of the images in the SmartGWT.jar will show up. To get those working, look at your gwt.properties file and change
                Code:
                gwt.output.dir=/com.test.Main
                to
                Code:
                gwt.output.dir=./
                Look at the auto generated HTML file and make sure you change
                Code:
                <script language="javascript" src="com.test.Main/com.test.Main.nocache.js"></script>
                to
                Code:
                <script language="javascript" src="com.test.Main.nocache.js"></script>
                There is no need to make changes above. Tip shown by Isomorphic in http://forums.smartclient.com/showthread.php?t=5325
                eliminates this problem.

                After adding this line to hosted HTML file
                Code:
                <script> var isomorphicDir = "[MODULE_NAME]/sc/"; </script>
                it works with default gwt.output.dir.

                Aleksandras

                Comment


                  #9
                  Smartgwt netbeans

                  I'd like to use smartgwt on netbeans 6.5.1 and tomcat, but even if i follow your instruction, no images are draw on page.
                  can anyone help me or post an example of configuration?
                  please.
                  thx to all

                  Comment


                    #10
                    Dear All,

                    Note: I am using NetBeans IDE 6.8, GWT 2.0.3 and SmartGWT 2.1 the latest versions as of today 16/03/2010

                    Initially I was trying to run one of the SmartGWT showcase examples, but there were some problems with its display, So I thought there might be some problem with its configuration, So I found this post and performed all the configuration as suggested by marcusocasey.

                    But now, I think the problem is due to some CSS issues, and I guess the configuration suggested by marcusocasey is no longer required in the latest version I am using because there is no difference on doing that configuration.

                    So I thought of mentioning out here, as It would save someone's time.

                    If anyone else has some different opinion, please provide thier inputs to this thread?

                    Kind regards,
                    Hardik

                    Comment


                      #11
                      NetBeans IDE 6.8 or 6.7, GWT 2.0.3 and SmartGWT 2.1

                      For NetBeans IDE 6.8 or 6.7, GWT 2.0.3 and SmartGWT 2.1 the following settings can be used:

                      - hosted HTML file: Web Pages->~.html
                      Code:
                      <script> var isomorphicDir = "[MODULE_NAME]/sc/"; </script>
                      - Source Packages->org.your...->~.gwt.xml
                      Code:
                      <inherits name="com.smartgwt.SmartGwt"/>
                      Best regards,

                      uzgeneral

                      Comment


                        #12
                        Hi !. My name is Agustin !; I'm living in Cordoba !. I've read all the instructions, but I keep getting errors... Could someone help me pls ?. This framework is really amazing !. I would only like help of how to install it !; the rest I see it by my own... Thankx !.

                        Comment

                        Working...
                        X