Search code examples
javascriptgwtextjschartsgwt-ext

GWT EXT Exception only in charts


I am trying to create a chart (graph) using the Line chart showcase code from GWT-EXT showcase as on http://www.gwt-ext.com/demo-charts/#lineChart But facing the following error in the browser:

onModuleLoad() threw an exception
Exception while loading module com.client.LineChartSample. See Development Mode for details.

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.gwtext.client.widgets.chart.yui.NumericAxis::create()([]): '$wnd.YAHOO.widget' is null or not an object
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.gwtext.client.widgets.chart.yui.NumericAxis.create(NumericAxis.java)
at com.gwtext.client.widgets.chart.yui.Axis.<init>(Axis.java:37)
at com.gwtext.client.widgets.chart.yui.NumericAxis.<init>(NumericAxis.java:33)
at com.client.LineChartSample.onModuleLoad(LineChartSample.java:66)
... 9 more

And following error in the development mode of Eclipse IDE [ERROR] [linechartsample] - Failed to load module 'linechartsample' from user agent 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36' at 127.0.0.1:54415 I have tried the other showcase codes of simple form, button etc. from the showcase which run without any problem. What could be the possible reason for this?


Solution

  • Got the answer.. I hadn't inherited an important module... The same code started working after adding the line :

    <inherits name="com.gwtext.Charts" />
    

    to the gwt.xml file... The rest all remain the same.