PDA

View Full Version : GWT compilation with SimpleComboBox gives StackOverflowError



jchaganti
25 Jun 2009, 6:35 AM
I am getting StackOverflowError error while doing GWT compilation of code containing SimpleComboBox.


Viewport view = new Viewport();
view.setBounds(0, 0, 900, 600);

TabPanel tp = new TabPanel();
tp.setBounds(0, 0, 900, 600);
tp.setBorders(true);

TabItem pti = new TabItem("Properties");
BorderLayout bl = new BorderLayout();
pti.setLayout(bl);
pti.setWidth("100%");

FormPanel north = new FormPanel();
north.setEncoding(Encoding.MULTIPART);
north.setMethod(Method.POST);
north.setHeading("Widgets demo");
north.setWidth("100%");

BorderLayoutData outNorth = new BorderLayoutData(LayoutRegion.NORTH);
outNorth.setMargins(new Margins(5, 5, 5, 5));
outNorth.setSize(100);

HBoxLayout hb = new HBoxLayout();
north.setLayout(hb);
HBoxLayoutData hbData = new HBoxLayoutData(5, 15, 5, 15);

SimpleComboBox<String> scb = new SimpleComboBox<String>();


Slider s = new Slider();
s.setMinValue(0);
s.setMaxValue(100);
s.setWidth(100);
s.setIncrement(1);
north.add(s, hbData);

Button b = new Button("Launch Wizard");
north.add(b, hbData);

LabelField l = new LabelField(" Upload file:");
north.add(l, new HBoxLayoutData(5,0,0,0));
FileUploadField fu = new FileUploadField();
north.add(fu, hbData);

b = new Button("Launch BreadCrumb Demo");
north.add(b, hbData);

LayoutContainer centerContainer = new LayoutContainer();
centerContainer.setWidth("100%");

ContentPanel propertiesListPanel = new ContentPanel();
propertiesListPanel.setHeading("Properties List");
propertiesListPanel.setBodyBorder(true);
//propertiesListPanel.setHeight(600);
ContentPanel googleMapPanel = new ContentPanel();
googleMapPanel.setHeading("Google Map");
googleMapPanel.setBodyBorder(true);

BorderLayoutData inWest = new BorderLayoutData(LayoutRegion.WEST);
inWest.setMargins(new Margins(5, 5, 5, 5));
inWest.setSize(500);

BorderLayoutData inCenter = new BorderLayoutData(LayoutRegion.CENTER);
inCenter.setMargins(new Margins(5, 5, 5, 5));
inCenter.setSize(400);
centerContainer.setLayout(new BorderLayout());
centerContainer.add(propertiesListPanel, inWest);
centerContainer.add(googleMapPanel, inCenter);

pti.add(north, outNorth);
pti.add(centerContainer, new BorderLayoutData(LayoutRegion.CENTER));


tp.add(pti);
TabItem pt2 = new TabItem("Customer");
pt2.setWidth("100%");
tp.add(pt2);
view.add(tp, new MarginData(100, 200, 50, 200));
RootPanel.get().add(view);Just remove the line "SimpleComboBox<String> scb = new SimpleComboBox<String>();" and it compiles.

I am using GXT 2.0-m3 , GWT 1.6.4, JDK 1.6, eclipse 3.4. I tried the following options:

1) Increased the jvm's stack size to 16M using Xss switch. If I use 32M, eclipse throws OutOfMemory errors.
2. I tried the patch given in http://code.google.com/p/google-web-toolkit/issues/detail?id=3510&can=5

But did not help.

If this has been fixed, kindly let me know. Or else this could be a bug.

Thanks,
jchaganti

sven
25 Jun 2009, 6:37 AM
When you increase your stacksize you should also try to increase the maximum memory usage.

jchaganti
25 Jun 2009, 6:43 AM
I had increased my max memory usage to 1024m. But even that did not help.

Following are the jvm args:

-Xss16m
-Xms1024m
-Xmx1024m
-XX:+UseParallelGC
-XX:CompileThreshold=5

cleahy
3 Jul 2009, 1:15 AM
Hi,
I'm having the same problem, but only when trying to compile from within eclipse. Compiling on the command line using maven works fine.
I'm using the m2eclipse plugin for maven, and the gwt-maven plugin from http://mojo.codehaus.org/gwt-maven-plugin/eclipse-mojo.html for compiling the GWT code.

Charlie

cleahy
3 Jul 2009, 2:33 AM
Actually also experiencing this issue at the command line now.

cleahy
3 Jul 2009, 3:16 AM
Fixed by following this:

http://mojo.codehaus.org/gwt-maven-plugin/user-guide/compiler.html

Yukideluxe
3 Jul 2009, 3:38 AM
Look if your error is like this http://code.google.com/p/google-web-toolkit/issues/detail?id=3510 and use the patch that is provided by scottb in the comments

jchaganti
3 Jul 2009, 6:33 AM
Yes, the patch provided http://code.google.com/p/google-web-toolkit/issues/detail?id=3510&can=5 fixes this issue.

Ensure that the patch jar comes in your classpath before gwt-dev-<platform>.jar.