Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Caused by: com.google.gwt.core.client.JavaScriptException:(Ty peError):_1 is undefined

    1. the SmartGWT or SmartClient version and browser version(s) involved;
    SmartGWT 2.5 and Mozilla Firefox 5.0

    --------------------------------------------------------------------------

    2. for a server-side problem, the complete logs generated during processing of the request;
    16:22:19.411 [ERROR] [cubeexample] Uncaught exception escaped
    com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
    at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
    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.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    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.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): _1 is undefined
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.smartgwt.client.widgets.Canvas.addChild(Canvas.java)
    at com.cubeexample.client.CubeExample$1.onClick(CubeExample.java:52) ------------>"error at w.addChild(cube) in my CubeExample.java"
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:99)
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
    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.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    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.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Unknown Source)

    --------------------------------------------------------------------------

    3. for a client-side problem, the contents of the Developer Console (see FAQ for usage);
    [WARN] Server class 'com.isomorphic.servlet.CompressionFilter' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/smartgwtee-2.5/lib/isomorphic_core_rpc.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html
    === SmartClient Init: log4j.isc.config.xml not found in CLASSPATH. Assuming log4j configuration for com.isomorphic is located in some other log4j configuration file.
    [WARN] Server class 'org.apache.commons.collections.map.AbstractMapDecorator' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/gwt-dev.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html
    [WARN] Server class 'isc.org.apache.oro.text.perl.Perl5Util' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/smartgwtee-2.5/lib/isc-jakarta-oro-2.0.6.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html
    [WARN] Server class 'com.isomorphic.compression.ServletCompression' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/smartgwtee-2.5/lib/isomorphic_compression.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html
    log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.JspRuntimeContext).
    log4j:WARN Please initialize the log4j system properly.
    [WARN] Server class 'org.apache.commons.pool.impl.GenericKeyedObjectPool' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/smartgwtee-2.5/lib/commons-pool-1.4.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html
    [WARN] Server class 'org.apache.commons.jxpath.AbstractFactory' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/smartgwtee-2.5/lib/commons-jxpath-1.3.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html
    [WARN] Server class 'org.apache.velocity.context.Context' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/smartgwtee-2.5/lib/velocity-1.6.1.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html
    [WARN] Server class 'org.apache.commons.fileupload.FileItemFactory' could not be found in the web app, but was found on the system classpath
    [WARN] Adding classpath entry 'file:/C:/New%20Softwares/smartgwtee-2.5/lib/commons-fileupload-1.2.1.jar' to the web app classpath for this session
    For additional info see: file:/C:/New%20Softwares/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.3.0.r36v201105191508/gwt-2.3.0/doc/helpInfo/webAppClassPath.html

    --------------------------------------------------------------------------

    4. if there is a JavaScript error, the stack trace logged in the Developer Console (from Internet Explorer if possible); and

    --------------------------------------------------------------------------

    5. sample code;

    CubeExample.java
    public class CubeExample implements EntryPoint {

    public void onModuleLoad() {

    final Window w = new Window();

    IButton b = new IButton("Please");
    RootPanel.get().add(b);
    b.addClickHandler(new ClickHandler() {

    @Override
    public void onClick(ClickEvent event) {

    w.setWidth("80%");
    w.setHeight("80%");
    w.setTitle("Dash Board");
    w.setShowMinimizeButton(false);
    w.setIsModal(true);
    //w.setShowModalMask(true);
    w.centerInPage();

    if(SC.hasAnalytics())
    {
    CubeGrid cube = new CubeGrid();
    if(SC.hasDrawing())
    {
    cube.setEnableCharting(true);
    }
    //cube.setData(SetTradeData.getData());
    cube.setDataSource(DataSource.get("category"));
    cube.setWidth100();
    cube.setHeight100();
    cube.setHideEmptyFacetValues(true);
    cube.setShowCellContextMenus(true);
    cube.setColumnFacets("product","metric");
    cube.setRowFacets("category", "subCategory");
    cube.setValueProperty("count");

    w.addChild(cube);
    }
    else {
    HTMLFlow htmlFlow = new HTMLFlow("<div class='explorerCheckErrorMessage'><p>This example is disabled in this SDK because it requires the optional " +
    "<a href=\"http://www.smartclient.com/product/index.jsp\" target=\"_blank\">Analytics module</a>.</p>" +
    "<p>Click <a href=\"http://www.smartclient.com/smartgwtee/showcase/#cube-basic\" target=\"\">here</a> to see this example on smartclient.com</p></div>");
    htmlFlow.setWidth100();
    w.addMember(htmlFlow);
    }

    w.show();
    }

    });

    }
    }

    --------------------------------------------------------------------------

    category.ds.xml
    <DataSource
    ID="category"
    serverConstructor="com.cubeexample.server.CategoryDataSource"
    mappedBeanClass="com.cubeexample.server.Category">
    <fields>
    <field name="category" type="text" ></field>
    <field name="subCategory" type="text" ></field>
    <field name="product" type="text" ></field>
    <field name="metric" type="text" ></field>
    <field name="count" type="integer" ></field>
    </fields>
    </DataSource>

    CategoryDataSource.java
    @SuppressWarnings("serial")
    public class CategoryDataSource extends BasicDataSource {

    private String productName = "FX";
    private static Connection conn;

    @Override
    public DSResponse executeFetch(DSRequest req) throws Exception {

    DSResponse dsResponse = new DSResponse();

    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection("my server", "my username", "my password");
    } catch (ClassNotFoundException e) {
    e.printStackTrace();
    } catch (SQLException e) {
    e.printStackTrace();
    }

    String sql ="select cs.category, cs.sub_category, cs.count " +
    "from source_reference sr, product_type pt, etl_batch_detail ebd, " +
    "feed_stat fs, category_stat cs " +
    "where ebd.product_id = pt.product_type_id and ebd.source_id = sr.source_id and " +
    "ebd.batch_id = fs.batch_id and fs.feed_id = cs.feed_id and " +
    "pt.product_type = '" + productName + "'";
    // and " +
    //"ebd.business_date = '" + businessDate + "'";
    PreparedStatement stmt = conn.prepareStatement(sql);
    ResultSet rs = stmt.executeQuery(sql);
    Category c;
    List<Category> lc = new ArrayList<Category>();
    while(rs.next()) {
    c = new Category(rs.getString(1), rs.getString(2), "Product", "Exception Count", rs.getInt(3));
    lc.add(c);
    }
    dsResponse.setData(lc);
    return dsResponse;

    }

    }

    Category.java
    public class Category extends ListGridRecord {

    public Category(String category, String subCategory, String product, String metric, int count)
    {
    setAttribute("category", category);
    setAttribute("subCategory", subCategory);
    setAttribute("product", product);
    setAttribute("metric", metric);
    setAttribute("count", count);
    }

    }

    --------------------------------------------------------------------------

    CubeExample.gwt.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <module rename-to='cubeexample'>
    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name='com.google.gwt.user.User'/>

    <!-- Inherit the default GWT style sheet. You can change -->
    <!-- the theme of your GWT application by uncommenting -->
    <!-- any one of the following lines. -->
    <inherits name='com.google.gwt.user.theme.clean.Clean'/>
    <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
    <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
    <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
    <inherits name="com.smartgwtee.SmartGwtEE"/>
    <inherits name="com.smartgwt.Drawing"/>
    <inherits name="com.smartgwt.Analytics"/>
    <inherits name="com.smartgwtee.tools.Tools"/>

    <!-- Other module inherits -->

    <!-- Specify the app entry point class. -->
    <entry-point class='com.citi.cubeexample.client.CubeExample'/>

    <!-- Specify the paths for translatable code -->
    <source path='client'/>
    <source path='shared'/>

    </module>

    --> When I use the same CubeGrid, instead of setting the datasource, if I am using cube.setData() and set some hard-coded data, the above is working. But using datasource method, this does not work, Please help in this issue.
    Last edited by Koripella; 8 Sep 2011, 13:39.
Working...
X