Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 4th Dec 2008, 07:11
marcusocasey marcusocasey is offline
Registered Developer
 
Join Date: Dec 2008
Posts: 12
Default 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" maxmemory="512M">
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!
Reply With Quote
  #2  
Old 4th Dec 2008, 08:49
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 35,751
Default

Thanks for posting that Marcus, that's very helpful.
Reply With Quote
  #3  
Old 22nd Dec 2008, 12:16
girishkolantra girishkolantra is offline
Registered Developer
 
Join Date: Dec 2008
Posts: 1
Default

It works like a charm. I tried it on tomcat
Reply With Quote
  #4  
Old 30th Jan 2009, 08:12
farrukh_najmi farrukh_najmi is offline
Registered Developer
 
Join Date: Jan 2009
Posts: 235
Default 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
Reply With Quote
  #5  
Old 3rd Mar 2009, 16:24
Aaldaaf Aaldaaf is offline
Registered Developer
 
Join Date: Feb 2009
Posts: 7
Default 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
Reply With Quote
  #6  
Old 4th Mar 2009, 04:06
javanewb javanewb is offline
Registered Developer
 
Join Date: Feb 2009
Posts: 6
Default

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.
Reply With Quote
  #7  
Old 4th Mar 2009, 06:39
nlotz nlotz is offline
Registered Developer
 
Join Date: Sep 2008
Posts: 88
Default

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 ?
Reply With Quote
  #8  
Old 26th Apr 2009, 10:41
alius alius is offline
Registered Developer
 
Join Date: Mar 2009
Posts: 193
Default

Quote:
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
Reply With Quote
  #9  
Old 31st Oct 2009, 10:48
adcristofaro adcristofaro is offline
Registered Developer
 
Join Date: Oct 2009
Posts: 1
Default 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
Reply With Quote
  #10  
Old 16th Mar 2010, 03:46
hardikraja hardikraja is offline
Registered Developer
 
Join Date: Mar 2010
Posts: 6
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved