$wnd.google has no properties

36 views
Skip to first unread message

Rafael

unread,
Apr 30, 2009, 1:35:52 PM4/30/09
to Google Visualization API
I am trying to display a simple PieChart and i get the following
error:

[ERROR] Unable to load module entry point class
ar.com.akyasociados.dietaclubweb.client.DietaClubWeb (see associated
exception for details)
com.google.gwt.core.client.JavaScriptException: (TypeError):
$wnd.google has no properties
fileName: jar:file:/shared/downloads/Ajax/GWT/gwt-visualization-1.0.1/
gwt-visualization.jar!/com/google/gwt/visualization/client/
DataTable.java
lineNumber: 32
stack: ()@jar:file:/shared/downloads/Ajax/GWT/gwt-visualization-1.0.1/
gwt-visualization.jar!/com/google/gwt/visualization/client/
DataTable.java:32
gwtOnLoad([object Window],"dietaclubweb","1.6")@:0
gwtOnLoad(undefined,"dietaclubweb","http://localhost:8080/
dietaclubweb/")@http://localhost:8080/dietaclubweb/hosted.html?
dietaclubweb:20
nc()@http://localhost:8080/dietaclubweb/dietaclubweb.nocache.js:2
()@http://localhost:8080/dietaclubweb/dietaclubweb.nocache.js:8
@http://localhost:8080/dietaclubweb/hosted.html?dietaclubweb:39

at com.google.gwt.visualization.client.DataTable$.create(Native
Method)
at ar.com.akyasociados.dietaclubweb.client.DietaClubWeb.initPage
(DietaClubWeb.java:108)
at
ar.com.akyasociados.dietaclubweb.client.DietaClubWeb.onModuleLoad
(DietaClubWeb.java:46)


I read a while ago that the Visualization-API is only compatible with
1.4 version of the GWT, could that be it?

thanks in advance

I might add this gwt-visualization-api looks pretty cool...

Eric Z. Ayers

unread,
May 1, 2009, 10:53:08 AM5/1/09
to Google Visualization API
Hi Rafael,

This message indicates that you are accessing the API before it has
been loaded into your browsers. See:

http://code.google.com/docreader/#p=gwt-google-apis&s=gwt-google-apis&t=VisualizationFAQ

Rafael Barrera Oro

unread,
May 4, 2009, 10:34:29 AM5/4/09
to google-visua...@googlegroups.com

Eric Z. Ayers

unread,
May 4, 2009, 3:24:01 PM5/4/09
to Google Visualization API
Hi Rafael,

If you haven't tried the tutorial yet, that's certainly a good place
to start!

On May 4, 10:34 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> Thanks for the reply but the FAQ refers to the error
> "'$wnd.google.visualization' is null or not an object" and what i am getting
> is "$wnd.google has no properties" Are those equivalent?
>
> On the other hand i created the project using eclipse instead of following
> the step by step console tutorial to create a project, maybe that had
> something to do?
>
> i cant make it work yet...
>
> thanks for the reply!
>
> Any other ideas will be greatly appreciated
>
> Rafael
>
> 2009/5/1 Eric Z. Ayers <zun...@google.com>
>
>
>
> > Hi Rafael,
>
> > This message indicates that you are accessing the API before it has
> > been loaded into your browsers.  See:
>
> >http://code.google.com/docreader/#p=gwt-google-apis&s=gwt-google-apis...

Rafael Barrera Oro

unread,
May 4, 2009, 3:29:13 PM5/4/09
to google-visua...@googlegroups.com
Im sorry, i did not express myself correctly. What i meant was that i followed the tutorial with a slight variation, i created the project using the eclipse plugin (added the jar, set the classpath, etc).

I guess you could say that technically i did not followed the tutorial step by step but this should work anyway... right?

Thanks for the reply!

2009/5/4 Eric Z. Ayers <zun...@google.com>

Rafael Barrera Oro

unread,
May 5, 2009, 12:08:35 PM5/5/09
to google-visua...@googlegroups.com
Just to be certain, i followed the tutorial step by step, created the project by command line and it still does not work... (same error, $wnd.google has no properties)

I am thinking version problems... but then again, i dont know very much about the gwt visualization api...

Thanks in advance for any ideas

Rafael


2009/5/4 Rafael Barrera Oro <bora...@gmail.com>

VizBoy

unread,
May 6, 2009, 6:25:20 AM5/6/09
to google-visua...@googlegroups.com
"$wnd.google has no properties" usually means that you haven't included the jsapi script tag in the html page.

Hope this helps.

- VizBoy.

Rafael Barrera Oro

unread,
May 6, 2009, 10:41:41 AM5/6/09
to google-visua...@googlegroups.com
The following is my main html page code, as you can see i included the JSAPI (it was all along), is there something i forgot?



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- The HTML 4.01 Transitional DOCTYPE declaration-->
<!-- above set at the top of the file will set     -->
<!-- the browser's rendering engine into           -->
<!-- "Quirks Mode". Replacing this declaration     -->
<!-- with a "Standards Mode" doctype is supported, -->
<!-- but may lead to some differences in layout.   -->

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!--                                           -->
    <!-- Any title is fine                         -->
    <!--                                           -->
    <title>SimpleViz</title>
   
    <!--                                           -->
    <!-- This script loads the Visualization API.  -->
    <!--                                           -->
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
   
    <!--                                           -->
    <!-- This script loads your compiled module.   -->
    <!-- If you add any GWT meta tags, they must   -->
    <!-- be added before this line.                -->
    <!--                                           -->
    <script type="text/javascript" language="javascript" src="com.example.simpleviz.SimpleViz.nocache.js"></script>
  </head>

  <!--                                           -->
  <!-- The body can have arbitrary html, or      -->
  <!-- you can leave the body empty if you want  -->
  <!-- to create a completely dynamic UI.        -->
  <!--                                           -->
  <body>

    <!-- OPTIONAL: include this if you want history support -->
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
   
  </body>
</html>

2009/5/6 VizBoy <viz...@google.com>

Eric Z. Ayers

unread,
May 6, 2009, 11:08:41 AM5/6/09
to Google Visualization API
Hmmm, is your development machine able to connect through the internet
to http://www.google.com/jsapi? Sometimes proxies or firewalls
interfere with downloading the API. If you put that URL into a
browser on the machine you are developing from, you should see text
that starts with:

if (!window['google']) {
window['google'] = {};
}
...
> > On Tue, May 5, 2009 at 7:08 PM, Rafael Barrera Oro <boraf...@gmail.com>wrote:
>
> >> Just to be certain, i followed the tutorial step by step, created the
> >> project by command line and it still does not work... (same error,
> >> $wnd.google has no properties)
>
> >> I am thinking version problems... but then again, i dont know very much
> >> about the gwt visualization api...
>
> >> Thanks in advance for any ideas
>
> >> Rafael
>
> >> 2009/5/4 Rafael Barrera Oro <boraf...@gmail.com>

Rafael Barrera Oro

unread,
May 6, 2009, 11:27:37 AM5/6/09
to google-visua...@googlegroups.com
I should mention that i am working in hosted mode (if i type www.google.com/jsapi in my every day browser i get the expected outcome), when i type www.google.com/jsapi in the hosted browser i get a www.google.com could not be found error, i tryed adding it to the whitelist using the whitelist argument but it did not work

is this part of the problem or am i on the wrong track?

Thanks for the reply!

Rafael

2009/5/6 Eric Z. Ayers <zun...@google.com>

Eric Z. Ayers

unread,
May 7, 2009, 8:04:40 AM5/7/09
to Google Visualization API
Ah! This is a big clue. The hosted mode browser in windows embeds
Internet Explorer. There must be some setting in the Internet
Options on IE that affects your network connectivity or blocks certain
sites. I've seen this come up in a previous posting to some group,
but I can't find it now.

-Eric.

On May 6, 11:27 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> I should mention that i am working in hosted mode (if i typewww.google.com/jsapiin my every day browser i get the expected outcome),
> when i typewww.google.com/jsapiin the hosted browser i get awww.google.comcould not be found error, i tryed adding it to the whitelist
> using the whitelist argument but it did not work
>
> is this part of the problem or am i on the wrong track?
>
> Thanks for the reply!
>
> Rafael
>
> 2009/5/6 Eric Z. Ayers <zun...@google.com>
>
>
>
> > Hmmm, is your development machine able to connect through the internet
> > tohttp://www.google.com/jsapi? Sometimes proxies or firewalls

Rafael Barrera Oro

unread,
May 7, 2009, 10:54:48 AM5/7/09
to google-visua...@googlegroups.com
I should also mention that i am using Linux :P

2009/5/7 Eric Z. Ayers <zun...@google.com>

Eric Z. Ayers

unread,
May 8, 2009, 10:13:01 AM5/8/09
to Google Visualization API
Hi Rafael,

Sounds like a frustrating problem! At this point, it looks like the
problem has nothing to do with the visualization api in particular.
Maybe you should try looking for answers on the Google-Web-Toolkit
group if you haven't already.

You can post this link to the thread we are on so you don't have to go
through describing everything again.

http://groups.google.com/group/google-visualization-api/browse_thread/thread/a2e8abda771ffd01?hl=en

-Eric.

On May 7, 10:54 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> I should also mention that i am using Linux :P
>
> 2009/5/7 Eric Z. Ayers <zun...@google.com>
>
>
>
> > Ah!  This is a big clue.  The hosted mode browser in windows embeds
> > Internet Explorer.   There must be some setting in the Internet
> > Options on IE that affects your network connectivity or blocks certain
> > sites.  I've seen this come up in a previous posting to some group,
> > but I can't find it now.
>
> > -Eric.
>
> > On May 6, 11:27 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> > > I should mention that i am working in hosted mode (if i
> > typewww.google.com/jsapiinmy every day browser i get the expected
> > outcome),
> > > when i typewww.google.com/jsapiinthe hosted browser i get
> > awww.google.comcouldnot be found error, i tryed adding it to the whitelist
> > > using the whitelist argument but it did not work
>
> > > is this part of the problem or am i on the wrong track?
>
> > > Thanks for the reply!
>
> > > Rafael
>
> > > 2009/5/6 Eric Z. Ayers <zun...@google.com>
>
> > > > Hmmm, is your development machine able to connect through the internet
> > > > tohttp://www.google.com/jsapi?Sometimes proxies or firewalls

Rafael Barrera Oro

unread,
May 8, 2009, 12:16:40 PM5/8/09
to google-visua...@googlegroups.com
Frustrating indeed!

I shall try the GWT groups and see what happends...

Thanks for all the help anyway!

Rafael

2009/5/8 Eric Z. Ayers <zun...@google.com>

Craig Schroeder

unread,
May 9, 2009, 6:19:33 AM5/9/09
to google-visua...@googlegroups.com
Rafael,

One point to consider is if all your visualization related GWT code is in the proper place.

I'm sure you've seen the examples, but as a reminder....
Anything that looks like "x = new ColumnChart();" needs to be inside of the callback used when making the AJAX call or called from that callback.
i.e. if you want to use a callback called onLoadCallback as done in the examples you'd get the following:

  public void onModuleLoad() {
    Runnable onLoadCallback = new Runnable() {
      public void run() {
        x = new AnnotatedTimeLine("700", "300");
        y = new Table();
        z = new ColumnChart();
        .............
      }
    }
    .............
    AjaxLoader.loadVisualizationApi(onLoadCallback, ColumnChart.PACKAGE, Table.PACKAGE, AnnotatedTimeLine.PACKAGE);
  }

--Craig

Rafael Barrera Oro

unread,
May 13, 2009, 11:52:21 AM5/13/09
to google-visua...@googlegroups.com
I am creating a PieChart within a callback method (see the code below) so i think that should not be a problem.

    // Create a callback to be called when the visualization API
    // has been loaded.

    Runnable onLoadCallback = new Runnable() {
      public void run() {
        Panel panel = RootPanel.get();
 
        // Create a pie chart visualization.
        PieChart pie = new PieChart(createTable(), createOptions());

        pie.addSelectHandler(createSelectHandler(pie));
        panel.add(pie);
      }
    };

    // Load the visualization api, passing the onLoadCallback to be called
    // when loading is done.
    AjaxLoader.loadVisualizationApi(onLoadCallback, PieChart.PACKAGE);
  }

Anyway, i discovered that if the project is packaged into a war and deployed on a tomcat server, the PieChart works perfectly, its only in hosted mode that it does not work, i still think is some problem with the way that the hosted browser behaves (if i type www.google.com/jsapi in the hosted browser i get a not found error).

¡Thanks for the reply!

Rafael

2009/5/9 Craig Schroeder <craig...@gmail.com>

michaeltang

unread,
Jun 4, 2009, 1:17:22 AM6/4/09
to Google Visualization API
I ran into same problem with eclipse gwt plugin and debugging in host
mode. Command line works fine.

I doubt it could be related to the security check that the original
page is from localhost but the browser could not access a different
domain "www.google.com".

-Michael

On May 13, 8:52 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> I am creating a PieChart within a callback method (see the code below) so i
> think that should not be a problem.
>
>     // Create a callback to be called when the visualization API
>     // has been loaded.
>     Runnable onLoadCallback = new Runnable() {
>       public void run() {
>         Panel panel = RootPanel.get();
>
>         // Create a pie chart visualization.
>         PieChart pie = new PieChart(createTable(), createOptions());
>
>         pie.addSelectHandler(createSelectHandler(pie));
>         panel.add(pie);
>       }
>     };
>
>     // Load the visualization api, passing the onLoadCallback to be called
>     // when loading is done.
>     AjaxLoader.loadVisualizationApi(onLoadCallback, PieChart.PACKAGE);
>   }
>
> Anyway, i discovered that if the project is packaged into a war and deployed
> on a tomcat server, the PieChart works perfectly, its only in hosted mode
> that it does not work, i still think is some problem with the way that the
> hosted browser behaves (if i typewww.google.com/jsapiin the hosted browser
> i get a not found error).
>
> ¡Thanks for the reply!
>
> Rafael
>
> 2009/5/9 Craig Schroeder <craigdat...@gmail.com>
>
>
>
> > Rafael,
> > One point to consider is if all your visualization related GWT code is in
> > the proper place.
>
> > I'm sure you've seen the examples, but as a reminder....
> > Anything that looks like "x = new ColumnChart();" needs to be inside of the
> > callback used when making the AJAX call or called from that callback.
> > i.e. if you want to use a callback called onLoadCallback as done in the
> > examples you'd get the following:
>
> >   public void onModuleLoad() {
> >     Runnable onLoadCallback = new Runnable() {
> >       public void run() {
> >         x = new AnnotatedTimeLine("700", "300");
> >         y = new Table();
> >         z = new ColumnChart();
> >         .............
> >       }
> >     }
> >     .............
> >     AjaxLoader.loadVisualizationApi(onLoadCallback, ColumnChart.PACKAGE,
> > Table.PACKAGE, AnnotatedTimeLine.PACKAGE);
> >   }
>
> > --Craig
>
> > On Fri, May 8, 2009 at 12:16 PM, Rafael Barrera Oro <boraf...@gmail.com>wrote:
>
> >> Frustrating indeed!
>
> >> I shall try the GWT groups and see what happends...
>
> >> Thanks for all the help anyway!
>
> >> Rafael
>
> >> 2009/5/8 Eric Z. Ayers <zun...@google.com>
>
> >>> Hi Rafael,
>
> >>> Sounds like a frustrating problem!  At this point, it looks like the
> >>> problem has nothing to do with the visualization api in particular.
> >>> Maybe you should try looking for answers on the Google-Web-Toolkit
> >>> group if you haven't already.
>
> >>> You can post this link to the thread we are on so you don't have to go
> >>> through describing everything again.
>
> >>>http://groups.google.com/group/google-visualization-api/browse_thread...
>
> >>> -Eric.
>
> >>> On May 7, 10:54 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> >>> > I should also mention that i am using Linux :P
>
> >>> > 2009/5/7 Eric Z. Ayers <zun...@google.com>
>
> >>> > > Ah!  This is a big clue.  The hosted mode browser in windows embeds
> >>> > > Internet Explorer.   There must be some setting in the Internet
> >>> > > Options on IE that affects your network connectivity or blocks
> >>> certain
> >>> > > sites.  I've seen this come up in a previous posting to some group,
> >>> > > but I can't find it now.
>
> >>> > > -Eric.
>
> >>> > > On May 6, 11:27 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> >>> > > > I should mention that i am working in hosted mode (if i
> >>> > > typewww.google.com/jsapiinmyevery day browser i get the expected
> >>> > > outcome),
> >>> > > > when i typewww.google.com/jsapiinthehosted browser i get
> >>> > > awww.google.comcouldnotbe found error, i tryed adding it to the
> >>> whitelist
> >>> > > > using the whitelist argument but it did not work
>
> >>> > > > is this part of the problem or am i on the wrong track?
>
> >>> > > > Thanks for the reply!
>
> >>> > > > Rafael
>
> >>> > > > 2009/5/6 Eric Z. Ayers <zun...@google.com>
>
> >>> > > > > Hmmm, is your development machine able to connect through the
> >>> internet
> >>> > > > > tohttp://www.google.com/jsapi?Sometimesproxies or firewalls
> ...
>
> read more »

michaeltang

unread,
Jun 4, 2009, 1:33:40 AM6/4/09
to Google Visualization API
ok. I found out my problem is I forgot to put the following code in my
html file:

<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load("visualization", "1", {'packages' : ["piechart",
"table"] });
</script>

-Michael
On May 13, 8:52 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> I am creating a PieChart within a callback method (see the code below) so i
> think that should not be a problem.
>
>     // Create a callback to be called when the visualization API
>     // has been loaded.
>     Runnable onLoadCallback = new Runnable() {
>       public void run() {
>         Panel panel = RootPanel.get();
>
>         // Create a pie chart visualization.
>         PieChart pie = new PieChart(createTable(), createOptions());
>
>         pie.addSelectHandler(createSelectHandler(pie));
>         panel.add(pie);
>       }
>     };
>
>     // Load the visualization api, passing the onLoadCallback to be called
>     // when loading is done.
>     AjaxLoader.loadVisualizationApi(onLoadCallback, PieChart.PACKAGE);
>   }
>
> Anyway, i discovered that if the project is packaged into a war and deployed
> on a tomcat server, the PieChart works perfectly, its only in hosted mode
> that it does not work, i still think is some problem with the way that the
> hosted browser behaves (if i typewww.google.com/jsapiin the hosted browser
> i get a not found error).
>
> ¡Thanks for the reply!
>
> Rafael
>
> 2009/5/9 Craig Schroeder <craigdat...@gmail.com>
>
>
>
> > Rafael,
> > One point to consider is if all your visualization related GWT code is in
> > the proper place.
>
> > I'm sure you've seen the examples, but as a reminder....
> > Anything that looks like "x = new ColumnChart();" needs to be inside of the
> > callback used when making the AJAX call or called from that callback.
> > i.e. if you want to use a callback called onLoadCallback as done in the
> > examples you'd get the following:
>
> >   public void onModuleLoad() {
> >     Runnable onLoadCallback = new Runnable() {
> >       public void run() {
> >         x = new AnnotatedTimeLine("700", "300");
> >         y = new Table();
> >         z = new ColumnChart();
> >         .............
> >       }
> >     }
> >     .............
> >     AjaxLoader.loadVisualizationApi(onLoadCallback, ColumnChart.PACKAGE,
> > Table.PACKAGE, AnnotatedTimeLine.PACKAGE);
> >   }
>
> > --Craig
>
> > On Fri, May 8, 2009 at 12:16 PM, Rafael Barrera Oro <boraf...@gmail.com>wrote:
>
> >> Frustrating indeed!
>
> >> I shall try the GWT groups and see what happends...
>
> >> Thanks for all the help anyway!
>
> >> Rafael
>
> >> 2009/5/8 Eric Z. Ayers <zun...@google.com>
>
> >>> Hi Rafael,
>
> >>> Sounds like a frustrating problem!  At this point, it looks like the
> >>> problem has nothing to do with the visualization api in particular.
> >>> Maybe you should try looking for answers on the Google-Web-Toolkit
> >>> group if you haven't already.
>
> >>> You can post this link to the thread we are on so you don't have to go
> >>> through describing everything again.
>
> >>>http://groups.google.com/group/google-visualization-api/browse_thread...
>
> >>> -Eric.
>
> >>> On May 7, 10:54 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> >>> > I should also mention that i am using Linux :P
>
> >>> > 2009/5/7 Eric Z. Ayers <zun...@google.com>
>
> >>> > > Ah!  This is a big clue.  The hosted mode browser in windows embeds
> >>> > > Internet Explorer.   There must be some setting in the Internet
> >>> > > Options on IE that affects your network connectivity or blocks
> >>> certain
> >>> > > sites.  I've seen this come up in a previous posting to some group,
> >>> > > but I can't find it now.
>
> >>> > > -Eric.
>
> >>> > > On May 6, 11:27 am, Rafael Barrera Oro <boraf...@gmail.com> wrote:
> >>> > > > I should mention that i am working in hosted mode (if i
> >>> > > typewww.google.com/jsapiinmyevery day browser i get the expected
> >>> > > outcome),
> >>> > > > when i typewww.google.com/jsapiinthehosted browser i get
> >>> > > awww.google.comcouldnotbe found error, i tryed adding it to the
> >>> whitelist
> >>> > > > using the whitelist argument but it did not work
>
> >>> > > > is this part of the problem or am i on the wrong track?
>
> >>> > > > Thanks for the reply!
>
> >>> > > > Rafael
>
> >>> > > > 2009/5/6 Eric Z. Ayers <zun...@google.com>
>
> >>> > > > > Hmmm, is your development machine able to connect through the
> >>> internet
> >>> > > > > tohttp://www.google.com/jsapi?Sometimesproxies or firewalls
> ...
>
> read more »

googelybear

unread,
Jun 4, 2009, 6:48:55 PM6/4/09
to Google Visualization API
btw. I think the prefered way of loading the vis packages is via
VisualizationUtils.loadVisualizationApi(PieChart.package, ...,
myCallback) instead of via the hostpage...so you can be sure that when
the callback gets called the visualizations are ready to roll (this
has been buggy before but is now fixed on google's servers).
> > hosted browser behaves (if i typewww.google.com/jsapiinthe hosted browser
> > >>> > > typewww.google.com/jsapiinmyeveryday browser i get the expected
> > >>> > > outcome),
> > >>> > > > when i typewww.google.com/jsapiinthehostedbrowser i get
> > >>> > > awww.google.comcouldnotbefound error, i tryed adding it to the
> > >>> whitelist
> > >>> > > > using the whitelist argument but it did not work
>
> > >>> > > > is this part of the problem or am i on the wrong track?
>
> > >>> > > > Thanks for the reply!
>
> > >>> > > > Rafael
>
> > >>> > > > 2009/5/6 Eric Z. Ayers <zun...@google.com>
>
> > >>> > > > > Hmmm, is your development machine able to connect through the
> > >>> internet
> > >>> > > > > tohttp://www.google.com/jsapi?Sometimesproxiesor firewalls
> ...
>
> Erfahren Sie mehr »
Reply all
Reply to author
Forward
0 new messages