Announcement

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

    Can not use XMLTools.loadXMLSchema() with modules-debug

    Hi,
    I am not able to debug sources using modules-debug because of exception in XMLTools.loadXMLSchema() method.
    Using standard setup:
    index.html
    Code:
    <!DOCTYPE html>
    
    <html>
        <head>
    
            <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            <meta http-equiv="pragma" content="no-cache">
            <meta name="gwt:property" content="locale=pl">
            
            <title>Client</title>
            
        </head>
    
        <body>
    
            <script type="text/javascript">
                var isomorphicDir = "./sc/";
            </script>
    
            <script src="sc/modules/ISC_Core.js">          </script>
            <script src="sc/modules/ISC_Foundation.js">    </script>
            <script src="sc/modules/ISC_Containers.js">    </script>
            <script src="sc/modules/ISC_Grids.js">         </script>
            <script src="sc/modules/ISC_Forms.js">         </script>
            <script src="sc/modules/ISC_RichTextEditor.js"></script>
            <script src="sc/modules/ISC_Calendar.js">      </script>
            <script src="sc/modules/ISC_DataBinding.js">   </script>
         
            <script src="sc/skins/Graphite/load_skin.js"></script>
    
            <script src="pl.com.tech4.index.nocache.js"></script>
    
        </body>
    </html>
    index.gwt.xml
    Code:
    <module>
    
        <!-- Inherit the core Web Toolkit stuff -->
        <inherits name='com.google.gwt.user.User'/>
        <!-- GWT internationalization -->
        <!--inherits name="com.google.gwt.i18n.I18N"/-->
    
        <inherits name="com.smartgwt.SmartGwtNoScript"/>
        <!--inherits name="com.smartgwt.debug.SmartGwtNoScriptDebug"/-->
    
        <!-- only necessary with SmartGwtNoScript -->
        <inherits name="com.smartclient.theme.graphite.GraphiteResources"/>
        
        <inherits name="com.smartgwt.tools.SmartGwtTools"/>
    
        <!--inherits name="com.reveregroup.gwt.imagepreloader.ImagePreloader" /-->
        
        <entry-point class="pl.com.tech4.client.MainEntryPoint"/>
    
        <!--extend-property name="locale" values="en"/-->
        <extend-property name="locale" values="pl"/>
        <set-property-fallback name="locale" value="pl"/>
     
        <set-property name="user.agent" value="safari"/>
        <!--set-property name="user.agent" value="gecko1_8,ie6,ie8"/-->
    
        <!--inherits name='org.timepedia.exporter.Exporter'/-->
        <!--set-property name="export" value="yes"/-->
    
        <!-- SuperDevMode -->
        <add-linker name="xsiframe"/>
        <set-configuration-property name="devModeRedirectEnabled" value="true"/>
        <!-- enable source maps -->
        <set-property name="compiler.useSourceMaps" value="true" />
    
    </module>
    The following sample runs well:
    Code:
    package pl.com.tech4.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.SchemaSet;
    import com.smartgwt.client.data.XMLTools;
    import com.smartgwt.client.data.XSDLoadCallback;
    import com.smartgwt.client.util.SC;
    
    public class MainEntryPoint implements EntryPoint {
       
        public void onModuleLoad() {
    
            XMLTools.loadXMLSchema("menuDS.xsd", new XSDLoadCallback() {
    
                public void execute(SchemaSet schemaSet) {
                    SC.logEcho(schemaSet.getJsObj());
                }
            });
        }
       
    }
    menuDS.xsd
    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
                targetNamespace="urn:menus.schema.tech.com.pl"
                xmlns:tns="urn:menus.schema.tech.com.pl"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    
        <xsd:simpleType name="LocalizedString">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
                    
        <xsd:complexType name="Node">
            <xsd:sequence>
                <xsd:element name="name" minOccurs="1" maxOccurs="1">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:minLength value="1"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:element>
                <xsd:element name="title" type="tns:LocalizedString" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="description" type="tns:LocalizedString" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="icon" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="thumbnail" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="seqIndex" type="xsd:integer" minOccurs="0" maxOccurs="1"/>
    
                <xsd:element name="panel" type="xsd:string" minOccurs="1" maxOccurs="1"/>
            </xsd:sequence>
            <xsd:attribute name="keep" type="xsd:boolean" />
        </xsd:complexType>
    
        <xsd:complexType name="Menu">
            <xsd:sequence>
                <xsd:element name="name" minOccurs="1" maxOccurs="1">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:minLength value="1"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:element>
                <xsd:element name="title" type="tns:LocalizedString" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="thumbnail" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="seqIndex" type="xsd:integer" minOccurs="0" maxOccurs="1"/>
                <xsd:sequence>
                    <xsd:element name="menu" type="tns:Menu" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:sequence>
                    <xsd:element name="node" type="tns:Node" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:sequence>
            <xsd:attribute name="keep" type="xsd:boolean" />
        </xsd:complexType>
    
        <xsd:complexType name="Application">
            <xsd:sequence>
                <xsd:element name="name" minOccurs="1" maxOccurs="1">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:minLength value="1"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:element>
                <xsd:element name="title" type="tns:LocalizedString" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="description" type="tns:LocalizedString" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="version" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="icon" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="thumbnail" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="iconHeight" type="xsd:integer" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="iconWidth" type="xsd:integer" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="dateFormat" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="dateTimeFormat" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="amountFormat" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="currencyFormat" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="moneyAmountFormat" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="docUrl" type="xsd:string" minOccurs="0" maxOccurs="1"/>
                <xsd:element name="textMatchStyle" type="xsd:string" minOccurs="0" maxOccurs="1"/>
            </xsd:sequence>
            <xsd:attribute name="keep" type="xsd:boolean" />
        </xsd:complexType>
    
    
        <xsd:element name="root">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="application" type="tns:Application" minOccurs="0" maxOccurs="1"/>
                    <xsd:element name="component" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element name="menu" type="tns:Menu" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element name="node" type="tns:Node" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        
    </xsd:schema>
    and produces this log:
    12:11:38.184:XRP2:WARN:Log:SchemaSet{schemaNamespace: "urn:menus.schema.tech.com.pl",
    qualifyAll: false,
    schemaImports: Array[0],
    schema: Array[5],
    ID: "isc_SchemaSet_0",
    location: "menuDS.xsd"}

    But, if I change setup to use modules-debug:
    index.html
    Code:
    <!DOCTYPE html>
    
    <html>
        <head>
    
            <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            <meta http-equiv="pragma" content="no-cache">
            <meta name="gwt:property" content="locale=pl">
            
            <title>Client</title>
            
        </head>
    
        <body>
    
            <script type="text/javascript">
                var isomorphicDir = "./sc/";
            </script>
    
            <script src="sc/modules-debug/ISC_Core.js">          </script>
            <script src="sc/modules-debug/ISC_Foundation.js">    </script>
            <script src="sc/modules-debug/ISC_Containers.js">    </script>
            <script src="sc/modules-debug/ISC_Grids.js">         </script>
            <script src="sc/modules-debug/ISC_Forms.js">         </script>
            <script src="sc/modules-debug/ISC_RichTextEditor.js"></script>
            <script src="sc/modules-debug/ISC_Calendar.js">      </script>
            <script src="sc/modules-debug/ISC_DataBinding.js">   </script>
         
            <script src="sc/skins/Graphite/load_skin.js"></script>
    
            <script src="pl.com.tech4.index.nocache.js"></script>
    
        </body>
    </html>
    index.gwt.xml
    Code:
    <module>
    
        <!-- Inherit the core Web Toolkit stuff -->
        <inherits name='com.google.gwt.user.User'/>
        <!-- GWT internationalization -->
        <!--inherits name="com.google.gwt.i18n.I18N"/-->
    
        <!--inherits name="com.smartgwt.SmartGwtNoScript"/-->
        <inherits name="com.smartgwt.debug.SmartGwtNoScriptDebug"/>
    
        <!-- only necessary with SmartGwtNoScript -->
        <inherits name="com.smartclient.theme.graphite.GraphiteResources"/>
        
        <inherits name="com.smartgwt.tools.SmartGwtTools"/>
    
        <!--inherits name="com.reveregroup.gwt.imagepreloader.ImagePreloader" /-->
        
        <entry-point class="pl.com.tech4.client.MainEntryPoint"/>
    
        <!--extend-property name="locale" values="en"/-->
        <extend-property name="locale" values="pl"/>
        <set-property-fallback name="locale" value="pl"/>
     
        <set-property name="user.agent" value="safari"/>
        <!--set-property name="user.agent" value="gecko1_8,ie6,ie8"/-->
    
        <!--inherits name='org.timepedia.exporter.Exporter'/-->
        <!--set-property name="export" value="yes"/-->
    
        <!-- SuperDevMode -->
        <add-linker name="xsiframe"/>
        <set-configuration-property name="devModeRedirectEnabled" value="true"/>
        <!-- enable source maps -->
        <set-property name="compiler.useSourceMaps" value="true" />
    
    </module>
    clear cache, rebuild and run the same sample again then I got this exception on Developer Console:
    Code:
    12:23:39.754:XRP4:WARN:Log:TypeError: Cannot read property 'ID' of undefined
    Stack from error.stack:
    and GWT Developer Console shows:
    Code:
    00:00:09,263 [ERROR] 12:27:06.153:XRP7:WARN:Log:TypeError: elem is null Stack from error.stack: unnamed() @ :144 __gwt_javaInvokes[1]() @ ?gwt.codesvr=127.0.0.1:9997:205 unnamed() @ :41 .fireCallback() @ sc/client/language/Class.js:1867 ._completeLoad() @ sc/client/language/XMLTools.js:2185 ._loadSchemaToJSReply() @ sc/client/language/XMLTools.js:2176 ._loadSchemaReply() @ sc/client/language/XMLTools.js:2132 .loadWSDL/<() @ sc/client/language/XMLTools.js:2084 .fireCallback() @ sc/client/language/Class.js:1867 ._getXMLResponseReply() @ sc/client/language/XMLTools.js:260 .fireCallback() @ sc/client/language/Class.js:1867 .fireCallback() @ sc/client/language/Class.js:3718 .fireReplyCallback() @ sc/client/application/RPCManager.js:4668 $wnd.isc.RPCManager.fireReplyCallback() @ :311 .fireReplyCallbacks() @ sc/client/application/RPCManager.js:4730 .performOperationReply() @ sc/client/application/RPCManager.js:4659 ._performTransactionReply() @ sc/client/application/RPCManager.js:4573 .performTransactionReply() @ sc/client/application/RPCManager.js:3935 anonymous() @ sc/client/language/Object.js:151 .fireCallback() @ sc/client/language/Class.js:1867 .performXmlTransactionReply() @ sc/client/communications/Comm.js:438 anonymous() @ sc/client/language/Object.js:151 .fireCallback() @ sc/client/language/Class.js:1870 ._fireXMLCallback() @ sc/client/communications/Comm.js:101 .sendXmlHttpRequest/loadFunc() @ sc/client/communications/Comm.js:337
    com.smartgwt.client.core.JsObject$SGWT_WARN: 12:27:06.153:XRP7:WARN:Log:TypeError: elem is null Stack from error.stack:     unnamed() @ :144     __gwt_javaInvokes[1]() @ ?gwt.codesvr=127.0.0.1:9997:205     unnamed() @ :41     .fireCallback() @ sc/client/language/Class.js:1867     ._completeLoad() @ sc/client/language/XMLTools.js:2185     ._loadSchemaToJSReply() @ sc/client/language/XMLTools.js:2176     ._loadSchemaReply() @ sc/client/language/XMLTools.js:2132     .loadWSDL/<() @ sc/client/language/XMLTools.js:2084     .fireCallback() @ sc/client/language/Class.js:1867     ._getXMLResponseReply() @ sc/client/language/XMLTools.js:260     .fireCallback() @ sc/client/language/Class.js:1867     .fireCallback() @ sc/client/language/Class.js:3718     .fireReplyCallback() @ sc/client/application/RPCManager.js:4668     $wnd.isc.RPCManager.fireReplyCallback() @ :311     .fireReplyCallbacks() @ sc/client/application/RPCManager.js:4730     .performOperationReply() @ sc/client/application/RPCManager.js:4659     ._performTransactionReply() @ sc/client/application/RPCManager.js:4573     .performTransactionReply() @ sc/client/application/RPCManager.js:3935     anonymous() @ sc/client/language/Object.js:151     .fireCallback() @ sc/client/language/Class.js:1867     .performXmlTransactionReply() @ sc/client/communications/Comm.js:438     anonymous() @ sc/client/language/Object.js:151     .fireCallback() @ sc/client/language/Class.js:1870     ._fireXMLCallback() @ sc/client/communications/Comm.js:101     .sendXmlHttpRequest/loadFunc() @ sc/client/communications/Comm.js:337      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)     at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)     at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)     at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)     at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)     at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)     at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)     at java.lang.Thread.run(Thread.java:745)
    Thanks,
    MichalG

    SmartClient Version: v11.0p_2016-07-14/LGPL Development Only (built 2016-07-14)
    Firefox 24.8.0, Chrominium 38.0.2125.101 (290379) (64-bit)
    Gentoo linux
    GWT 2.6.0

    #2
    As far as the immediate error you're getting about inability to use error.stack, this was reported by another user, and we applied a fix that seems to correct the issue for that user, even though we weren't able to reproduce it ourselves. So you should update to the latest patched build; that may fix the entire problem, or just allow you to see the actual issue.

    Comment


      #3
      Using latest build: SmartClient Version: v11.0p_2016-08-11/LGPL Development Only (built 2016-08-11)
      I have go the same trimmed error stack in log (clean-rebuild and browser cache cleared):
      Code:
      15:55:20.061:INFO:Log:initialized
      15:55:21.006:INFO:Log:isc.Page is loaded
      15:55:21.209:XRP2:WARN:Log:TypeError: Cannot read property 'ID' of undefined
      Stack from error.stack:
      MichalG

      Comment


        #4
        And here is stack trace from Chrominium debbuger with sources loaded:
        Code:
        getAttribute_0 (JSOHelper.java:177)
        $internalSetID (BaseClass.java:156)
        setJavaScriptObject (BaseClass.java:117)
        SchemaSet_0 (SchemaSet.java:28)
        (anonymous function) (XMLTools.java:201)
        isc.Class.addClassMethods.fireCallback (Class.js:1870)
        isc.defineClass.addClassProperties._completeLoad (XMLTools.js:2185)
        isc.defineClass.addClassProperties._loadSchemaToJSReply (XMLTools.js:2176)
        isc.defineClass.addClassProperties._loadSchemaReply (XMLTools.js:2132)
        (anonymous function) (XMLTools.js:2084)
        isc.Class.addClassMethods.fireCallback (Class.js:1870)
        isc.defineClass.addClassProperties._getXMLResponseReply (XMLTools.js:257)
        isc.Class.addClassMethods.fireCallback (Class.js:1870)
        isc.Class.addMethods.fireCallback (Class.js:3718)
        isc.RPCManager.addClassMethods.fireReplyCallback (RPCManager.js:4679)
        $wnd.isc.RPCManager.fireReplyCallback (SmartGwtEntryPoint.java:422)
        isc.RPCManager.addClassMethods.fireReplyCallbacks (RPCManager.js:4742)
        isc.RPCManager.addClassMethods.performOperationReply (RPCManager.js:4671)
        isc.RPCManager.addClassMethods._performTransactionReply (RPCManager.js:4585)
        isc.RPCManager.addClassMethods.performTransactionReply (RPCManager.js:3947)
        (anonymous function) (VM895:3)
        isc.Class.addClassMethods.fireCallback (Class.js:1870)
        isc.Comm.addClassMethods.performXmlTransactionReply (Comm.js:438)
        (anonymous function) (VM894:3)
        isc.Class.addClassMethods.fireCallback (Class.js:1870)
        isc.Comm.addClassMethods._fireXMLCallback (Comm.js:101)
        loadFunc (Comm.js:337)
        Code:
        <exception>: TypeError: Cannot read property 'ID' of undefined
        message: "Cannot read property 'ID' of undefined"
        stack: (...)
        get stack: function () { [native code] }
        set stack: function () { [native code] }
        __proto__: Error
        attr: "ID"
        elem: undefined
        ret: undefined
        this: Window[0]
        Window[0]
        Hope this help to resolve it.
        MichalG

        Comment


          #5
          The underlying error was due to a naming problem with the schema files. It's been addressed in SGWT 5.1p LGPL and newer branches, and should be in the nightly builds dated 2016-08-22 and beyond.

          The separate chrome-specific error-reporting problem (which affected all SGWT variants) should also have been resolved in the same nightly builds.

          Comment


            #6
            It is fixed for me (checked against SmartClient Version: v11.0p_2016-08-22/LGPL Development Only (built 2016-08-22)).
            Many thanks - it was troubling me for long.
            MichalG

            Comment

            Working...
            X