GWT Google Maps Eclipse configuration

620 views
Skip to first unread message

Luser_k

unread,
Apr 14, 2008, 3:01:24 PM4/14/08
to Google Web Toolkit
Please can someone help me out there?

I have eclipse and created a GWT project and imported the project into
my workspace of eclipse.
I add the external jars like

1. gwt-google-apis.jar
2. gwt-user.jar
3. gwt-dev-windows.jar

Although I add the jars, I get a exception that the apis can´t found
and that a inheritance didn´t work !?

I coded this in my .java:



package com.google.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.maps.client.InfoWindowContent;
import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.control.LargeMapControl;
import com.google.gwt.maps.client.geom.LatLng;
import com.google.gwt.user.client.ui.RootPanel;

public class rmaps implements EntryPoint {

public MapWidget map;

public void onModuleLoad() {

map = new MapWidget(new LatLng(39.509,-98.434),2);
map.setSize("500px","300px");
map.addControl(new LargeMapControl());
map.getInfoWindow().open(map.getCenter(),new
InfoWindowContent("Hallo Welt"));

RootPanel.get("slot2").add(map);
}
}





Thats the error message:

[TRACE] The development shell servlet received a request for
'rmaps.html' in module 'com.google.gwt.rmaps'
[TRACE] Loading module 'com.google.gwt.rmaps'
[TRACE] Loading inherited module 'com.google.gwt.maps.GoogleMaps'
[ERROR] Unable to find 'com/google/gwt/maps/GoogleMaps.gwt.xml' on
your classpath; could be a typo, or maybe you forgot to include a
classpath entry for source?
[ERROR] Line 5: Unexpected exception while processing element
'inherits'
[ERROR] Failure while parsing XML




Thats my module:

<module>

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.maps.GoogleMaps' />
<!-- Specify the app entry point class. -->
<entry-point class='com.google.gwt.client.rmaps'/>

</module>
================================================


How can I inherit the gwt-google api, "GoogleMaps.gwt.xml" ???
I mean, when I inherit it still doesnt work. I mean how can the
module know where that xml file locates? How do I eclipse say,
where that file is?

How can I put that file into my Classpath?

Can someone explain me very detailled how i can inherit and I mean
not just to put the inherit tag in the module.

Please help me!!!!

LFCPD

unread,
Apr 24, 2008, 5:20:42 AM4/24/08
to Google Web Toolkit

Have you added the library in Build Path? To do it follow these steps:

1. Right click on the project name in the Eclipse --> Build Path -->
Configure Build Path
2. Click on the button 'Add External JARs...'
3. Select the 'gwt-google-apis.jar' file (where you have downloaded
it)
4. Click on 'OK' button

And that's all!

Let me know if this works.

Regards.

Luser_k

unread,
Apr 26, 2008, 12:06:32 PM4/26/08
to Google Web Toolkit
Hi,

thanks for your reply.

I deleted my gwt-project and created a whole new project with the
applicationCreator and projectCreator.

- I added the external jar like you said with the build-path.
- I coded following code:

package com.reko.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.maps.client.InfoWindowContent;
import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.control.LargeMapControl;
import com.google.gwt.maps.client.geom.LatLng;
import com.google.gwt.user.client.ui.RootPanel;

public class MyGmapsApplication implements EntryPoint {


private MapWidget map;

public void onModuleLoad() {

map = new MapWidget(new LatLng(39.509,-98.434),2);
map.setSize("500px","500px");
map.addControl(new LargeMapControl());
map.getInfoWindow().open(map.getCenter(),new
InfoWindowContent("World's Largest Ball of Twine"));

RootPanel.get("slot1").add(map);
}
}

- When I compile and shell the code, I get this Exception from the
shell :

[TRACE] Analyzing source in module 'com.reko.MyGmapsApplication'
[ERROR] Line 4: The import com.google.gwt.maps cannot be resolved
[ERROR] Line 5: The import com.google.gwt.maps cannot be resolved
[ERROR] Line 6: The import com.google.gwt.maps cannot be resolved
[ERROR] Line 7: The import com.google.gwt.maps cannot be resolved
[ERROR] Line 23: MapWidget cannot be resolved to a type
[ERROR] Line 27: map cannot be resolved
[ERROR] Line 27: MapWidget cannot be resolved to a type
[ERROR] Line 27: LatLng cannot be resolved to a type
[ERROR] Line 29: map cannot be resolved
[ERROR] Line 31: map cannot be resolved
[ERROR] Line 31: LargeMapControl cannot be resolved to a type
[ERROR] Line 33: map cannot be resolved
[ERROR] Line 33: map cannot be resolved
[ERROR] Line 33: InfoWindowContent cannot be resolved to a type
[ERROR] Line 40: map cannot be resolved

[TRACE] Finding entry point classes
[ERROR] Unable to find type 'com.reko.client.MyGmapsApplication'
[ERROR] Hint: Previous compiler errors may have made this type
unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not
be inheriting a required module or a module may not be adding its
source path entries properly
[ERROR] Failure to load module 'com.reko.MyGmapsApplication'

[ERROR] Failure to load module 'null'
com.google.gwt.dev.shell.HostedModeException: Can't find frame window
for 1
at com.google.gwt.dev.shell.BrowserWidget.doUnload(BrowserWidget.java:
352)
at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access
$400(BrowserWidgetIE6.java:36)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.handleUnload(BrowserWidgetIE6.java:
109)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:
55)
at
com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:
125)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:
293)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:
196)
at
org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:
117)
at
org.eclipse.swt.internal.ole.win32.IOleInPlaceObject.InPlaceDeactivate(IOleInPlaceObject.java:
21)
at
org.eclipse.swt.ole.win32.OleClientSite.deactivateInPlaceClient(OleClientSite.java:
524)


- The import does not work, although I added the jar and the IDE
accepted it.
Could you please, really please explain me how I can solve my
problem?

Eric Ayers

unread,
Apr 30, 2008, 4:12:13 PM4/30/08
to Google Web Toolkit
I wrote up a step-by-step procedure for how to configure eclipse on
the gwt-google-api wiki page that others have found helpful. Have you
seen this yet?

http://code.google.com/p/gwt-google-apis/wiki/GettingStartedBasic

Also, I can tell by the name of the .jar file that you are using an
older version of the API. Try downloading the r290 milestone release:

http://code.google.com/p/gwt-google-apis/downloads/list?can=1&q=r290&colspec=Filename+Summary+Uploaded+Size+DownloadCount

Kick me if I don't update the GettingStartedBasic page to reflect the
new .jar file structure soon.
-Eric.
> [ERROR] Line 4: The import com.google.gwt.mapscannot be resolved
> [ERROR] Line 5: The import com.google.gwt.mapscannot be resolved
> [ERROR] Line 6: The import com.google.gwt.mapscannot be resolved
> [ERROR] Line 7: The import com.google.gwt.mapscannot be resolved
Reply all
Reply to author
Forward
0 new messages