3 Replies Latest reply on May 13, 2013 9:40 AM by jfuerth

    Reproducible "White screen of death"

    mdhirsch30345

      An ongoing problem with Errai and GWT is that sometimes it just fails without any error message.  I get complaints from my team about this very often.  I finally have a nice reproducible example to share.

       

      Start with the errai-ui demo from Lincoln Baxter.  In the class Spotlight.java, add this field:

          java.text.SimpleDateFormat format;

      Now build and deploy the application.

       

      When you try to view it you just get an empty, white browser with no content whatsoever.

       

      Of course, I know that SimpleDataFormat should not be used, but eclipse (not intellij, though!) lets me use it without warning.

       

      I don't know if it is Errai or GWT that should be issuing an error message, but someone should.  I would love a clear error message that states exactly where I made an error, but I would settle for any error with the filename and line number.

       

      Strangely, if you put the same line in App.java instead, you do get an error, but the error is not really correct.  It says:

           ERROR] org.jboss.errai.codegen.exception.GenerationException: No @AutoBound data binder found for @Bound @DataField username in class org.jboss.errai.ui.demo.client.local.App

       

      At least that shows me the right file, though I don't think that error message is very helpful.  This error message makes me think that Errai is having the trouble and not GWT.

       

      Thanks,

       

      Michael

        • 1. Re: Reproducible "White screen of death"
          jfuerth

          Hi Michael,

           

          I feel your frustration. There's nothing worse than a failure without any explanation.

           

          When this happens, I bet you get a message like this in the dev mode console:

           

          00:06:21.435  [INFO] Ignored 1 unit with compilation errors in first pass.
          Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
          

           

          This is what GWT does by default when it encounters non-translatable code. From Errai's point of view, these "ignored compilation units" simply don't exist. We can't see them at all in GWT's TypeOracle. Unfortunately, this means we can't have Errai emit an error message, because we don't know what we're missing.

           

          Often, compiling with -strict is enough. But not always. Sometimes you need to set the logLevel to DEBUG to see the error. Unfortunately, there is a lot of noise to deal with when the log level is set so low. You're looking for one or more messages like this:

           

          00:01:55.705  [TRACE] Errors in 'org/jboss/errai/jpa/sync/client/local/ClientSyncManager.java'
            00:01:55.705  [TRACE] Line 135: The method getSimpleName() is undefined for the type Class<capture#4-of ? extends SyncResponse>
          

           

          The key phrase to look for is "Errors in" .. and the actual compiler errors from GWT's embedded JDT will be beneath that node.

           

          Hope that helps!

           

          Jonathan

          • 2. Re: Reproducible "White screen of death"
            mdhirsch30345

            Thanks Jonathan.  That did catch this particular error.

             

            We only just upgraded to 2.3.0 and I forgot to turn on strict.  It didn't seem to work with 2.1.0.

             

            I'll put that in our build immediately.

             

            Is there a way to make dev-mode complain?  Does dev-mode have a "-strict"?

             

            Thanks,

             

            Michael

            • 3. Re: Reproducible "White screen of death"
              jfuerth

              Hi Michael,

               

              It appears you can't set Dev Mode for strict compiles. Not sure why, but it doesn't seem to be a documented option:

               

              Google Web Toolkit 2.5.1

              DevMode [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number | "auto"] [-server servletContainerLauncher[:args]] [-startupUrl url] [-war dir] [-deploy dir] [-extra dir] [-workDir dir] module[s]

               

              where

                -noserver        Prevents the embedded web server from running

                -port            Specifies the TCP port for the embedded web server (defaults to 8888)

                -whitelist       Allows the user to browse URLs that match the specified regexes (comma or space separated)

                -blacklist       Prevents the user browsing URLs that match the specified regexes (comma or space separated)

                -logdir          Logs to a file in the given directory, as well as graphically

                -logLevel        The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL

                -gen             Debugging: causes normally-transient generated types to be saved in the specified directory

                -bindAddress     Specifies the bind address for the code server and web server (defaults to 127.0.0.1)

                -codeServerPort  Specifies the TCP port for the code server (defaults to 9997)

                -server          Specify a different embedded web server to run (must implement ServletContainerLauncher)

                -startupUrl      Automatically launches the specified URL

                -war             The directory into which deployable output files will be written (defaults to 'war')

                -deploy          The directory into which deployable but not servable output files will be written (defaults to 'WEB-INF/deploy' under the -war directory/jar, and may be the same as the -extra directory/jar)

                -extra           The directory into which extra files, not intended for deployment, will be written

                -workDir         The compiler's working directory for internal use (must be writeable; defaults to a system temp dir)

              and

                module[s]        Specifies the name(s) of the module(s) to host

               

              -Jonathan