Drawing overlays leads to stackoverflowerror

5 views
Skip to first unread message

jkim

unread,
Jul 8, 2009, 8:29:19 PM7/8/09
to Google API Libraries for GWT
Hey guys,

I have added the capability to draw an polygon on my map.
however, if i try to add a marker to the map, when i compile it will
give me a stackoverflowerror.

[java] [ERROR] Unexpected internal compiler error
[java] java.lang.StackOverflowError
[java] at java.util.concurrent.ConcurrentHashMap$Segment.get
(Concurrent
HashMap.java:338)
[java] at java.util.concurrent.ConcurrentHashMap.get
(ConcurrentHashMap.
java:769)
[java] at java.io.ObjectStreamClass.lookup
(ObjectStreamClass.java:268)
[java] at java.io.ObjectOutputStream.writeObject0
(ObjectOutputStream.ja
va:1106)
[java] at java.io.ObjectOutputStream.writeObject
(ObjectOutputStream.jav
a:326)
[java] at java.util.ArrayList.writeObject(ArrayList.java:570)
[java] at sun.reflect.GeneratedMethodAccessor55.invoke
(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMet
hodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at java.io.ObjectStreamClass.invokeWriteObject
(ObjectStreamClass
.java:945)
[java] at java.io.ObjectOutputStream.writeSerialData
(ObjectOutputStream
.java:1461)

here is a snippet of my code:
private void createPolyline(final MapWidget map) {
PolyStyleOptions style = PolyStyleOptions.newInstance("#FF0000", 1,
1.0);

final Polyline poly = new Polyline(new LatLng[0]);
map.addOverlay(poly);
poly.setDrawingEnabled();
poly.setStrokeStyle(style);

poly.addPolylineEndLineHandler(new PolylineEndLineHandler() {

public void onEnd(PolylineEndLineEvent event) {
LatLng[] points = new LatLng[] { poly.getBounds().getNorthEast(),
LatLng.newInstance(poly.getBounds().getNorthEast().getLatitude
(), poly.getBounds().getSouthWest().getLongitude()),
poly.getBounds().getSouthWest(),
LatLng.newInstance(poly.getBounds().getSouthWest().getLatitude
(), poly.getBounds().getNorthEast().getLongitude()),
poly.getBounds().getNorthEast() };

Polygon polygon = new Polygon(points, "#FF0000", 1, 1.0,
"#FF0000", .3);
map.addOverlay(polygon);
map.addOverlay(new Marker(LatLng.newInstance(poly.getBounds
().getNorthEast().getLatitude(), poly.getBounds().getSouthWest
().getLongitude())));
map.removeOverlay(poly);
}
});
}

The weird thing is, it will work fine in hosted mode but when i try to
build it with ant, it will throw the stackoverflowerror.

any help would be appreciated.

Regards,

jkim

Eric Ayers

unread,
Jul 9, 2009, 12:08:19 AM7/9/09
to gwt-goo...@googlegroups.com
Hi jkim,

One thing you can try is to bump your JVM stack size and heap size.
See this FAQ entry:

http://code.google.com/webtoolkit/doc/1.6/FAQ_DebuggingAndCompiling.html#Is_the_war_directory_used_by_GWT_compiler_for_both_input_and_output


-Eric.
--
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

jkim

unread,
Jul 9, 2009, 12:59:30 PM7/9/09
to Google API Libraries for GWT
Hey Eric,

haha i was so concerned about the error message that i forgot to look
at the comments in the build.xml.
it said it right there :)
thanks for pointing it out for me.

Regards,

Josh

On Jul 8, 9:08 pm, Eric Ayers <zun...@google.com> wrote:
> Hi jkim,
>
> One thing you can try is to bump your JVM stack size and heap size.
> See this FAQ entry:
>
> http://code.google.com/webtoolkit/doc/1.6/FAQ_DebuggingAndCompiling.h...
> Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://code.google.com/webtoolkit/- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages