Announcement

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

    Exception is not logged in the developer console

    SmartClient Version: v8.3d_2012-10-22/Pro Deployment (built 2012-10-22)

    GWT version: 2.5.0.rc1

    I'm just doing

    Code:
    throw new NullPointerException("I wanna see it");
    at the client side.

    I see alert window saying:

    Uncaught exception escaped : com.google.gwt.event.shared.UmbrellaException
    Exception caught: null
    See the Development console log for details.
    Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.
    but no sign of the exception can be found in developer console log.

    Developer console functions correctly in all other ways. Debug messages and other stuff is logged correctly.

    Maybe it's connected with gwt version.

    #2
    The Developer Console will log JavaScript errors, but this is not a JavaScript error, it's a thrown Java exception.

    Comment


      #3
      A repeat, at the CLIENT side. If you don't like NullPointerException, throw any you like, supported by GWT compiler.

      That means gwt compiler translates this into javascript, causing a javascript error. SmartGwt exception handler should catch it and log into developer console (as it's stated here), but it just eats it without any messages in the log.

      Comment


        #4
        I've looked through SmartGwtEntryPoint source code.

        Seems like Exception handler works fine. The problem is that GWT.log() doesn't write messages to developer console.

        What can be the cause?

        Comment


          #5
          That's correct, GWT.log() does not, in general, log things to the Developer Console. However Warning and higher logs from the Developer Console will appear in the GWT log.

          Comment


            #6
            Originally posted by Isomorphic View Post
            That's correct, GWT.log() does not, in general, log things to the Developer Console. However Warning and higher logs from the Developer Console will appear in the GWT log.
            That is very usefull info! Thank you very much :D

            And now let's get back to the problem.

            I've build from scratch sample "built-in-ds" from

            1) v8.2p_2012-10-30/Pro Deployment (built 2012-10-30)
            2) v8.3d_2012-10-22/Pro Deployment (built 2012-10-22)

            using
            1)gwt-2.5.0-final
            2)gwt-2.1.0

            I've changed BuiltInDS.java, added one line of code:

            Code:
            grid.addRecordClickHandler(new RecordClickHandler() {
                        public void onRecordClick(RecordClickEvent event) {
                            DSRecord record = (DSRecord) event.getRecord();
                            bindComponents(record.getDsName());
            		[b]throw new RuntimeException("show me");[/b]
                        }
                    });
            Exception is thrown, SmartGwtException handler in hosted mode alerts:

            Uncaught exception escaped : com.google.gwt.event.shared.UmbrellaException
            One or more exceptions caught, see full set in UmbrellaException#getCauses
            See the Development console log for details.
            Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling
            No sign of the exception in developer console log (hosted or compiled mode - no matter).

            Please tell me that you see a problem with smartgwt logging system here.

            Comment


              #7
              Once again, this is a thrown Java exception, not a JavaScript error. GWT does not allow a thrown Java exception to become an (uncaught) JavaScript error. So it does not appear in the Developer Console - GWT catches it before then.

              Comment


                #8
                GWT does not allow a thrown Java exception to become an (uncaught) JavaScript error
                I can't argue on this topic, seems like i have to read more about GWT and Exceptions. But it seems strange that you state that "GWT catches it before then" even though it's handled in SmartGwt default unhandledExceptionHandler which shows alert message...

                But let's change my code to native method to get javascript error

                Code:
                private static native String someName(String name) /*-{
                        abc.abc();
                        return 'abc';
                    }-*/;
                and call it (abc is not defined!! Javascript error).

                Code:
                grid.addRecordClickHandler(new RecordClickHandler() {
                            public void onRecordClick(RecordClickEvent event) {
                                DSRecord record = (DSRecord) event.getRecord();
                                bindComponents(record.getDsName());
                		someName("aaa");
                            }
                        });
                Still no message in the console.

                Alert in hosted mode is correct

                Uncaught exception escaped : com.google.gwt.event.shared.UmbrellaException
                Exception caught: (ReferenceError) @com.smartgwt.sample.client.BuiltInDS::someName(Ljava/lang/String;)([string: 'aaa']): abc is not defined
                See the Development console log for details.
                Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.
                Last edited by vostapenko; 30 Oct 2012, 11:50.

                Comment


                  #9
                  .. and have you checked what's in the console (as the message) suggests? Is there something wrong with it?

                  Note, you might be confused here: the Developer Console is the pop-up browser window that is unique to SmartGWT. The "Development console" that GWT refers to is the "Development" tab in Eclipse, which shows Development Mode debug information. Unfortunately GWT's way of referring to this is a bit unclear, especially as of changing terminology from "Hosted Mode" to "Development Mode".

                  Comment


                    #10
                    As I said in the first post, there's nothing wrong with the developer console. It's fully functional, except one thing: it doesn't log exceptions.

                    To be more precise, thr following is shown in the console

                    00:51:08.609:INFO:Log:initialized
                    00:51:08.617:WARN:Log:NOTE: Firebug is enabled. Firebug greatly slows the performance of applications that make heavy use of JavaScript. Isomorphic highly recommends Firebug for troubleshooting, but Firebug and other development tools should be disabled when assessing the real-world performance of SmartClient applications.
                    00:51:08.766:WARN:Log:New Class ID: 'DataView' collides with ID of existing object with value 'function DataView() {
                    [native code]
                    }'. Existing object will be replaced.
                    This conflict would be avoided by disabling ISC Simple Names mode. See documentation for further information.
                    00:51:08.768:WARN:Log:New Class ID: 'EditPane' collides with ID of existing Class object '[DataSource ID:EditPane]'. Existing object will be replaced.
                    This conflict would be avoided by disabling ISC Simple Names mode. See documentation for further information.
                    00:51:09.030:INFO:Log:isc.Page is loaded
                    And yes, i've checked it:D And yes, it's the one shown by the help of SC.showConsole();

                    To summarise: i've built built-in-ds from scratch for 3.1 and 3.0 and development console exceptions logging is not working.
                    Last edited by vostapenko; 30 Oct 2012, 12:57.

                    Comment


                      #11
                      Once again, there are two consoles, one that comes with GWT, and one that is specific to SmartGWT (see previous message for details) - you need to look at both, because sometimes GWT traps errors before SmartGWT could ever get them.

                      Comment


                        #12
                        I don't know what's eclipse development console, i'm using Intellij Idea. Exceptions are shown in the module log.

                        But i don't care about that, because it's not available in the production environment.

                        What i really need is showing exceptions in the SmartGwt (SC.showConsole()) developer console.

                        It's not in any way trapped by GWT, because errors are correctly handled by unhandledExceptionHandler registered in com.smartgwt.client.SmartGwtEntryPoint.

                        Please add my native function to BuiltInDS.java (clean build-in-ds example in 3.0 or 3.1 distr) and call it in any handler to see it your own eyes. If it's too time-consuming, please provide me with some info, how to help you with investigating.

                        Comment


                          #13
                          Oh, possibly we see the problem - you don't realize that you can just add your own handler and call SC.logWarn() to put info into the SmartGWT Developer Console?

                          Comment


                            #14
                            No this is not the problem. SC.logWarn() works just fine and i know about it.

                            The problem is that SmartGwt unhandledExceptionHandler registered in com.smartgwt.client.SmartGwtEntryPoint is not logging errors to developer console log.

                            Or the problem is that you're trolling me.

                            I Know about registering my own exception handlers and loggin everything on my own. But i'm reporting a possible bug in your code.

                            So, how can i help you with further investigation?

                            Comment


                              #15
                              Once again: if you don't like our UncaughtExceptionHandler, because you would like to make sure everything makes it to the Developer Console in a production deployment, you can replace it with your own.

                              Just call GWT.setUncaughtExceptionHandler() again.

                              Make sense?

                              Comment

                              Working...
                              X