Announcement

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

    Tip : Using the Developer Console

    The SmartClient Developer console is extremely useful in troubleshooting issues and displays really useful log messages (like duplicate ID's). It is useful to have it open at all times when you developing in hosted mode.

    Aug 17 2009 : Note that you now need to inherit the module com.smartgwt.tools.SmartGwtTools in order to be able to use the Developer Console


    The 11-24-2008 build has a method called Page.registerKey so you can add the following to your entry point :

    Code:
    if (!GWT.isScript()) {
        KeyIdentifier debugKey = new KeyIdentifier();
        debugKey.setCtrlKey(true);
        debugKey.setKeyName("D");
    
        Page.registerKey(debugKey, new KeyCallback() {
            public void execute(String keyName) {
                SC.showConsole();
            }
        });
    }
    This adds a shortcut Ctrl + D key to launch the Developer Console in hosted mode. This convenience shortcut will hopefully encourage users to make extensive use of the Developer Console. It is really a huge time saver when troubleshooting.

    Here's another tip:

    Viewing RPC responses in Dev Console

    Launch the Dev Console, go to the "RPC" tab and select the checkbox "Track RPCs". Now various SmartGWT communication's with the server gets logged in the display region.

    Sanjiv
    Last edited by sjivan; 17 Aug 2009, 17:32.

    #2
    Is it possible to sticky this post? As matter in fact, any useful tip from Sanjiv or SmartClient developers can be consolidated and be sticky? It is very helpful for new comer like myself.

    Thanks

    Comment


      #3
      Hi Sanjiv, thanks for the tip. One question though: what is exactly the purpose of the Smartclient Server? I see a tab Databases in the Developer Console which needs the Smartclient Server. Could you clarify this a little bit?

      Thanks,

      Damir

      Comment


        #4
        Hi Damir,

        There's a summary of the server-side features of SmartClient here. A version of SmartGWT that includes the SmartClient Server (like the Enterprise Evaluation packages for normal SmartClient) is being put together - stay tuned.

        Comment


          #5
          Here's another tip:

          Viewing RPC responses in Dev Console

          Launch the Dev Console, go to the "RPC" tab and select the checkbox "Track RPCs". Now various SmartGWT communication's with the server gets logged in the display region.

          Comment


            #6
            Has anyone had any luck using the WSDL tab on the dev console using SmartGWT? Or is this something that only works if you're using the server.

            Thanks.

            Comment


              #7
              It's got to be a local file (same host) or you need the server (in order to proxy).

              Comment


                #8
                getting errors...

                line: 18
                error: isc is undefined

                additional detail.

                I believe this used to work w/ the released version. I've just noticed this now that I've switched to the nightly build.

                Comment


                  #9
                  Originally posted by bwalsh
                  I believe this used to work w/ the released version. I've just noticed this now that I've switched to the nightly build.

                  confirmed it, reverted back to 1.0b1 and SC.showConsole(); works

                  (although KeyCallback not defined in 1.0b1 )

                  Comment


                    #10
                    @bwalsh Are you talking about launching the Developer Console? If "isc" is undefined, your page has not loaded SmartClient at all. Sounds like a munged install.

                    Comment


                      #11
                      Originally posted by bwalsh
                      confirmed it, reverted back to 1.0b1 and SC.showConsole(); works

                      (although KeyCallback not defined in 1.0b1 )
                      With me it does not show the developer console, too. Although the window pops up.
                      I am using the nightly build from 2008-12-17
                      Firebug reports two errors:
                      isc is not defined
                      http://localhost:8080/sc/system/helpers/Log.html
                      Line 19

                      saveState is not defined
                      http://localhost:8080/sc/system/helpers/Log.html
                      Line 1

                      I tested it with the com.smartgwt.SmartGwt and the com.smartgwt.SmartGwtDebug module.

                      Comment


                        #12
                        Switch to the latest build, too

                        Hello,

                        I switch to the latest build 12-18-2008, remove tomcat folder, bin folder and
                        I have some errors/warnings I never had with the release.

                        Error : the log window displays but stays blank.
                        ---------------------------------------------
                        It seems that some files can't be found : I have the following output

                        Code:
                        ... 
                        [TRACE] The development shell servlet received a request for 'sc/system/development/ISC_DeveloperConsole.js' in module 'erdf.mario.TheApplication.gwt.xml' 
                        [WARN] Resource not found: sc/system/development/ISC_DeveloperConsole.js; (could a file be missing from the public path or a <servlet> tag misconfigured in module erdf.mario.TheApplication.gwt.xml ?)
                        ...
                        ... and the same goes for :
                        - sc/system/development/ISC_FileLoader.js
                        - sc/system/development/ISC_Tools.js
                        - sc/skins/SmartClient/load_skin.js

                        Warning : JNSI malformed
                        -------------------------

                        I got a lot of warnings :

                        Code:
                        [WARN] Malformed JSNI reference 'constructor'; expect subsequent failures
                        java.lang.NoSuchFieldError: constructor
                        	at com.google.gwt.dev.shell.CompilingClassLoader$DispatchClassInfoOracle.getDispId(CompilingClassLoader.java:119)
                        	at com.google.gwt.dev.shell.CompilingClassLoader.getDispId(CompilingClassLoader.java:531)
                        	at com.google.gwt.dev.shell.ie.IDispatchProxy.getIDsOfNames(IDispatchProxy.java:124)
                        	at com.google.gwt.dev.shell.ie.IDispatchImpl.GetIDsOfNames(IDispatchImpl.java:273)
                        	at com.google.gwt.dev.shell.ie.IDispatchImpl.method5(IDispatchImpl.java:189)
                        	at org.eclipse.swt.internal.ole.win32.COMObject.callback5(COMObject.java:108)
                        	at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
                        	at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
                        	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
                        	at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
                        	at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
                        	at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvoke(ModuleSpaceIE6.java:152)
                        	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:447)
                        	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:228)
                        	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
                        	at com.smartgwt.client.widgets.form.DynamicForm.create(DynamicForm.java)
                        	at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:279)
                        	at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:791)
                        	at erdf.mario.client.AffinageEdit.createField(AffinageEdit.java:129)
                        	at erdf.mario.client.AffinageEdit.init(AffinageEdit.java:48)
                        	at erdf.mario.client.AffinageEdit.<init>(AffinageEdit.java:32)
                        	at erdf.mario.client.AffinageEdit.<init>(AffinageEdit.java:143)
                        	at erdf.mario.client.TheApplication.onModuleLoad(TheApplication.java:48)
                        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        	at java.lang.reflect.Method.invoke(Method.java:597)
                        	at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:320)
                        	at com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:329)
                        	at com.google.gwt.dev.shell.ie.BrowserWidgetIE6.access$300(BrowserWidgetIE6.java:37)
                        	at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.gwtOnLoad(BrowserWidgetIE6.java:76)
                        	at com.google.gwt.dev.shell.ie.BrowserWidgetIE6$External.invoke(BrowserWidgetIE6.java:139)
                        	at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
                        	at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
                        	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
                        	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
                        	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
                        	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
                        	at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
                        	at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
                        	at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)
                        For reference, here is my gwt.xml file
                        Code:
                        <module>
                        	  
                              <inherits name='com.extjs.gxt.ui.GXT'/>
                              <inherits name='com.google.gwt.user.User'/>
                        	
                              <inherits name='com.google.gwt.user.theme.standard.Standard'/>
                        
                              <!-- Other module inherits                                      -->
                              <inherits name="com.smartgwt.SmartGwt"/>
                        
                              <!-- Specify the app entry point class.                         -->
                              <entry-point class='erdf.mario.client.TheApplication'/>
                        	  <source path='domain'/>
                        	  <source path='client'/>
                            
                              <servlet path="/Service" class="erdf.mario.server.ServiceImpl" />
                            
                              <!-- Specify the application specific style sheet.              -->
                              <stylesheet src='TheApplication.css' />
                        	
                        </module>
                        Do you have an idea about what went wrong ?

                        Regards

                        Comment


                          #13
                          Ho to write to log?

                          Can somebody give simple example how to write to log? I can't find in any place...

                          10x

                          Comment


                            #14
                            Developer console does not work for me anymore, I'm using the 12/18/2008 nightly build. Worked with previous nightly build on 12/4/2008. The error message I get is the following:

                            Code:
                            A Runtime Error has occurred: 
                            Line 18: 'isc' is undefined

                            Comment


                              #15
                              @alonas You can write to the top via SC.logWarn() and related methods.

                              Comment

                              Working...
                              X