I am using Eclipse for debugging. I am using gwt-maps.jar, the
official google maps api for JAVA . Let me know if there is a bug with
loadFromWaypoints or it is something I did wrong, and how I can fix
this.
I chose the following method from
public static void loadFromWaypoints(Waypoint[] waypoints,
                                     DirectionsCallback callback)

    Load a new directions query using an array of waypoints as input
instead of a single query string.

    Parameters:
        waypoints - an array of waypoints.
        callback - methods to call when the load() succeeds or fails.


I didn't the other method of loadFromWaypoints because when I created
a new map and new directionspanel, errors started to come up. But this
method should work the same way.



I pinpointed the error from this class using F5:
private static JavaScriptObject createDirections(DirectionQueryOptions
options) {
    if (options == null) {
      return DirectionsImpl.impl.construct(null, null);
    } else if (options.panel != null) {
      return DirectionsImpl.impl.construct(options.map,
          options.panel.getElement());
    } else {
      return DirectionsImpl.impl.construct(options.map, null);
    }
  }

When I was debugging the code, the if(options== null) was true and
returned
DirectionsImpl.construct(null, null)

for(ii=0; ii<nodesList.size();ii++)
                {
                        for(jj=0;jj<nodesList.size();jj++)
                        {
                                final int iiIndex = ii;
                                final int jjIndex = jj;
                                if(ii!=jj)
                                {Directions.loadFromWaypoints(distmat[ii][jj], 
new
DirectionsCallback() {

                                      public void onFailure(int statusCode) {
                                        Window.alert("Failed to load 
directions: Status "
                                            + StatusCodes.getName(statusCode) + 
" " + statusCode);
                                      }

                                      public void onSuccess(DirectionResults 
result) {
                                        GWT.log("Successfully loaded 
directions.", null);
                                        Distance1[iiIndex]
[jjIndex]=result.getDistance().inMeters();
                                      }



                                    });
                                }
                        }
                }


My relevant code fragment is here:






error:
<H1>HTTP Status 500 - </H1>
<HR noShade SIZE=1>

<P><B>type</B> Exception report</P>
<P><B>message</B> <U></U></P>
<P><B>description</B> <U>The server encountered an internal error ()
that prevented it from fulfilling this request.</U></P>
<P><B>exception</B> <PRE>javax.servlet.ServletException: Servlet
execution threw an exception
</PRE>
<P></P>
<P><B>root cause</B> <PRE>java.lang.ExceptionInInitializerError
 
com.google.gwt.maps.client.geocode.Directions.createDirections(Directions.java:
171)

com.google.gwt.maps.client.geocode.Directions.loadFromWaypoints(Directions.java:
102)
 com

.google.gwt.maps.client.geocode.Directions.loadFromWaypoints(Directions.java:
127)
 de.herbstcampus.server.CVRPOutputs.costsMatrix(CVRPOutputs.java:163)
 de.herbstcampus.server.CVRPOutputs.&lt;init&gt;(CVRPOutputs.java:115)
 
de.herbstcampus.server.FileUploadServlet.getStringOutput(FileUploadServlet.java:
67)
 
de.herbstcampus.server.FileUploadServlet.doPost(FileUploadServlet.java:
28)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
290)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
</PRE>
<P></P>
<P><B>note</B> <U>The full stack trace of the root cause is available
in the Apache Tomcat/5.0.28 logs.</U></P>
<HR noShade SIZE=1>

<H3>Apache Tomcat/5.0.28</H3>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to