1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    13
    Vote Rating
    0
    balakishan.r is on a distinguished road

      0  

    Default Answered: Issue with AutoProgressBarMessagbox

    Answered: Issue with AutoProgressBarMessagbox


    I am facing an issue with AutoProgressBarMessagbox and Info. Getting below exception when initializing these components.

    Configuration: Java 6, GWT 2.5, GXT3.0.1, IE 9.0.12
    All of the team members have the same above configuration and code, no one is facing this issue except ME.

    Please help me on this. Thanks in advance.

    Exception stack trace:
    Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.sencha.gxt.widget.core.client.box.MessageBox$MessageBoxAppearance' (did you forget to inherit a required module?)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
    at com.google.gwt.core.shared.GWT.create(GWT.java:57)
    at com.google.gwt.core.client.GWT.create(GWT.java:85)
    at com.sencha.gxt.widget.core.client.box.MessageBox.<init>(MessageBox.java:117)
    at com.sencha.gxt.widget.core.client.box.AutoProgressMessageBox.<init>(AutoProgressMessageBox.java:68)
    at com.sencha.gxt.widget.core.client.box.AutoProgressMessageBox.<init>(AutoProgressMessageBox.java:55)

    Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:513)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
    at com.google.gwt.core.shared.GWT.create(GWT.java:57)
    at com.google.gwt.core.client.GWT.create(GWT.java:85)
    at com.sencha.gxt.widget.core.client.box.MessageBox.<init>(MessageBox.java:117)
    at com.sencha.gxt.widget.core.client.box.AutoProgressMessageBox.<init>(AutoProgressMessageBox.java:68)
    at com.sencha.gxt.widget.core.client.box.AutoProgressMessageBox.<init>(AutoProgressMessageBox.java:55)

    SEVERE: Program Error!
    java.lang.ArrayIndexOutOfBoundsException: 30
    at com.google.gwt.dom.client.StyleInjector$StyleInjectorImplIE.injectStyleSheet(StyleInjector.java:142)
    at com.google.gwt.dom.client.StyleInjector.flush(StyleInjector.java:389)
    at com.google.gwt.dom.client.StyleInjector.access$1(StyleInjector.java:374)
    at com.google.gwt.dom.client.StyleInjector$1.execute(StyleInjector.java:208)
    at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
    at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:228)
    at com.google.gwt.core.client.impl.SchedulerImpl.flushFinallyCommands(SchedulerImpl.java:327)
    at com.google.gwt.core.client.impl.Impl.exit(Impl.java:266)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:257)
    at sun.reflect.GeneratedMethodAccessor38.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: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(Unknown Source)

  2. Code:
    SEVERE: Program Error!
    java.lang.ArrayIndexOutOfBoundsException: 30
          at com.google.gwt.dom.client.StyleInjector$StyleInjectorImplIE.injectStyleSheet(StyleInjector.java:142)
    In GWT 2.5.0, line 142 is the bolded line:
    Code:
        @Override
        public StyleElement injectStyleSheet(String contents) {
          int numStyles = getDocumentStyleCount(); 
          if (numStyles < MAX_STYLE_SHEETS) {
            // Just create a new style element and add it to the list
            return createNewStyleSheet(contents);
          } else {
            /*
             * Find shortest style element to minimize re-parse time in the general
             * case.
             * 
             * We cache the lengths of the style sheets in order to avoid expensive
             * calls to retrieve their actual contents. Note that if another module
             * or script makes changes to the style sheets that we are unaware of,
             * the worst that will happen is that we will choose a style sheet to
             * append to that is not actually of minimum size.
             */
            int shortestLen = Integer.MAX_VALUE;
            int shortestIdx = -1;
            for (int i = 0; i < numStyles; i++) {
              int len = styleSheetLengths[i];
              if (len == 0) {
                // Cache the length
                len = styleSheetLengths[i] = getDocumentStyleSheetLength(i);
              }
              if (len <= shortestLen) {
                shortestLen = len;
                shortestIdx = i;
              }
            }
            styleSheetLengths[shortestIdx] += contents.length();
            return appendToStyleSheet(shortestIdx, contents, true); 
          }
        }
    This is in GWT itself, not in GXT, and that is the only method that manipulates the static field styleSheetLengths.

    According to the logic of that method, this else block will only be called if there is exactly the max number of stylesheets already (or too many). The only way there can be too many is if something else is adding new <style> tags to the page, which is going to break IE anyway - the whole reason for this class existing is that IE only supports a certain number of <style> elements.

    Somehow you seem to have more <style> elements rendering than your coworkers. Two likely scenarios:
    * Your page is different (you have extra <style> tags being added)
    * Your browser is different (malware or plugins that are adding <style> tags to the page and breaking the GWT app from working).

    If its the page, make sure your code is exactly the same - try asking a coworker to start the server and let you log into it, and have them log into yours. Otherwise, something is fundamentally different about your IE instance, that it somehow has more stylesheets than it should.

  3. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Answers
    107
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    Code:
    SEVERE: Program Error!
    java.lang.ArrayIndexOutOfBoundsException: 30
          at com.google.gwt.dom.client.StyleInjector$StyleInjectorImplIE.injectStyleSheet(StyleInjector.java:142)
    In GWT 2.5.0, line 142 is the bolded line:
    Code:
        @Override
        public StyleElement injectStyleSheet(String contents) {
          int numStyles = getDocumentStyleCount(); 
          if (numStyles < MAX_STYLE_SHEETS) {
            // Just create a new style element and add it to the list
            return createNewStyleSheet(contents);
          } else {
            /*
             * Find shortest style element to minimize re-parse time in the general
             * case.
             * 
             * We cache the lengths of the style sheets in order to avoid expensive
             * calls to retrieve their actual contents. Note that if another module
             * or script makes changes to the style sheets that we are unaware of,
             * the worst that will happen is that we will choose a style sheet to
             * append to that is not actually of minimum size.
             */
            int shortestLen = Integer.MAX_VALUE;
            int shortestIdx = -1;
            for (int i = 0; i < numStyles; i++) {
              int len = styleSheetLengths[i];
              if (len == 0) {
                // Cache the length
                len = styleSheetLengths[i] = getDocumentStyleSheetLength(i);
              }
              if (len <= shortestLen) {
                shortestLen = len;
                shortestIdx = i;
              }
            }
            styleSheetLengths[shortestIdx] += contents.length();
            return appendToStyleSheet(shortestIdx, contents, true); 
          }
        }
    This is in GWT itself, not in GXT, and that is the only method that manipulates the static field styleSheetLengths.

    According to the logic of that method, this else block will only be called if there is exactly the max number of stylesheets already (or too many). The only way there can be too many is if something else is adding new <style> tags to the page, which is going to break IE anyway - the whole reason for this class existing is that IE only supports a certain number of <style> elements.

    Somehow you seem to have more <style> elements rendering than your coworkers. Two likely scenarios:
    * Your page is different (you have extra <style> tags being added)
    * Your browser is different (malware or plugins that are adding <style> tags to the page and breaking the GWT app from working).

    If its the page, make sure your code is exactly the same - try asking a coworker to start the server and let you log into it, and have them log into yours. Otherwise, something is fundamentally different about your IE instance, that it somehow has more stylesheets than it should.

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    13
    Vote Rating
    0
    balakishan.r is on a distinguished road

      0  

    Default


    Excellent Colin, Thank you so much for your response.
    The issue is with IE skype plugin, after disabling the skype plugin in IE, it is working fine.

    Thanks again for your valuable suggestion.

  5. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    70
    Vote Rating
    5
    Andreas Samjeske is on a distinguished road

      0  

    Default


    Hi Colin,

    I got the same issue.
    IE8 and IE9; GXT 3.0.0b; GWT 2.5.0 and GWT 2.5.1

    1.) Is this only a problem in DevMode? I havent't discoverd it yet in HostedMode.
    2.) Is there a workaround or a GWT-Version in which this issue has been fixed? If not, is there a open issue at the GWT bug tracker?

  6. #5
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Answers
    107
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    From my quick re-read of the code, it should happen both in dev mode (as initially described in the first post of the thread) and in production mode. Can you confirm that you have the skype plugin installed, or some other browser plugin, and that disabling/removing that plugin fixes the issue?

    The problem in this thread is that Skype is modifying the page while it is running, which causes GWT to improperly track how many style tags have been created. GWT can probably be modified to fix this issue, but we'd be working around what I would consider to be a bug in the Skype plugin.

    Can you confirm that this is the same issue you are facing, since your symptoms seem different? If not, perhaps you should start a new thread to discuss your issue.

  7. #6
    Sencha User
    Join Date
    Jul 2011
    Posts
    70
    Vote Rating
    5
    Andreas Samjeske is on a distinguished road

      0  

    Default


    First of all, I got no (active) plugins at all. Never had any type of Skype SW on this machine.
    The skype problem may have triggert the problem for balakishan.r, but thats not the case for me.

    What I did:
    ListStore.replaceAll() fires in the end fireEvent(new StoreDataChangeEvent<M>());. This leads to an grid.unmask() in GroupingView.onDataChanged(se).
    Finally StyleInjector.injectStyleSheet(content) is called with content being "com-sencha-gxt-core-client-dom-Mask-MaskDefaultAppearance-MaskStyle-mask ... ".
    So, I get there at a different time via a different route, but the issue is the same.

    Code:
     Failed to create an instance of 'com.sencha.gxt.core.client.dom.Mask$MaskAppearance' via deferred binding 
    java.lang.ArrayIndexOutOfBoundsException: 30
        at com.google.gwt.dom.client.StyleInjector$StyleInjectorImplIE.injectStyleSheet(StyleInjector.java:142)
        at com.google.gwt.dom.client.StyleInjector.flush(StyleInjector.java:389)
        at com.google.gwt.dom.client.StyleInjector.inject(StyleInjector.java:411)
    ...
    I made some research:
    According to this source in IE6-9 "A sheet may @import up to 31 sheets".
    But GWT seems to think 30 is maximum:
    Code:
      public static class StyleInjectorImplIE extends StyleInjectorImpl {
    
        /**
         * The maximum number of style tags that can be handled by IE.
         */
        private static final int MAX_STYLE_SHEETS = 30;
        
        /**
         * A cache of the lengths of the current style sheets.  A value of 0
         * indicates that the length has not yet been retrieved.
         */
        private static int[] styleSheetLengths = new int[MAX_STYLE_SHEETS];
    So, the Skype plugin or in my case maybe the browser itself generates the 31st sheet. This leads to the crash we discovered:
    Code:
        @Override
        public StyleElement injectStyleSheet(String contents) {
          int numStyles = getDocumentStyleCount();  <<<===== GWT thinks, this is 30 as maximum.
          if (numStyles < MAX_STYLE_SHEETS) {
            // Just create a new style element and add it to the list
            return createNewStyleSheet(contents);
          } else {
            /*
             * Find shortest style element to minimize re-parse time in the general
             * case.
             * 
             * We cache the lengths of the style sheets in order to avoid expensive
             * calls to retrieve their actual contents. Note that if another module
             * or script makes changes to the style sheets that we are unaware of,
             * the worst that will happen is that we will choose a style sheet to
             * append to that is not actually of minimum size.
             */
            int shortestLen = Integer.MAX_VALUE;
            int shortestIdx = -1;
            for (int i = 0; i < numStyles; i++) {
              int len = styleSheetLengths[i]; <<<===== crashes, if i=30, triggert by numStyles being 31
              if (len == 0) {
                // Cache the length
                len = styleSheetLengths[i] = getDocumentStyleSheetLength(i);
              }
              if (len <= shortestLen) {
                shortestLen = len;
                shortestIdx = i;
              }
            }
            styleSheetLengths[shortestIdx] += contents.length();
            return appendToStyleSheet(shortestIdx, contents, true); 
          }
        }

  8. #7
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Answers
    107
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    Using 30 as a max instead of 31 is probably geared to allow other style tags on the page that are not GWT related. Making less tags than the max shouldn't cause any problems.

    To debug this, use IE's developer tools and look at each style tag to find out where each one comes from. You may find it easier to add this to your module to make it easier to read the GWT-generated CSS:
    Code:
    <set-configuration-property name="CssResource.style" value="pretty" />
    I agree that your stack trace is the same issue that we've discusses above, and clearly you are getting this in dev/hosted mode (otherwise you'd see a JavaScript stack trace instead of a Java one). If you can track this down, we can hopefully identify if it is something on your machine, or some part of your application. Can other developer or machine running IE reproduce this issue? Does sencha.com/examples have problems when you look at the developer tools console?

    If you have no plugins installed, you may still have this bug introduced by an external source - I've seen proxies and malware cause bugs in web applications by tampering with the page as it loads or after it is running to inject ads or clean up other content. This may be happening to you, but without a complete sample or the ability to test on your machine, it will be hard to tell.

  9. #8
    Sencha User
    Join Date
    Jul 2011
    Posts
    70
    Vote Rating
    5
    Andreas Samjeske is on a distinguished road

      0  

    Default


    Quote Originally Posted by Colin Alworth View Post
    Using 30 as a max instead of 31 is probably geared to allow other style tags on the page that are not GWT related. Making less tags than the max shouldn't cause any problems.
    Of course not. The key point is the other way around: if GWT would operate with an max of 31, it wouldn't be an issue, if a 3rd party shifts the number of sheets from 30 to 31.

    Quote Originally Posted by Colin Alworth View Post
    To debug this, use IE's developer tools and look at each style tag to find out where each one comes from. You may find it easier to add this to your module to make it easier to read the GWT-generated CSS:
    Code:
    <set-configuration-property name="CssResource.style" value="pretty" />
    I agree that your stack trace is the same issue that we've discusses above, and clearly you are getting this in dev/hosted mode (otherwise you'd see a JavaScript stack trace instead of a Java one). If you can track this down, we can hopefully identify if it is something on your machine, or some part of your application. Can other developer or machine running IE reproduce this issue? Does sencha.com/examples have problems when you look at the developer tools console?
    - CSSResource is already set to pretty. All sheets seem to be from my applikation.
    - Haven't tried other machine yet. It happens to me on native IE9 and virtual machine with IE8.
    - sencha.com/examples is fine, since there are only 19 sheets in the mix.

    Quote Originally Posted by Colin Alworth View Post
    If you have no plugins installed, you may still have this bug introduced by an external source - I've seen proxies and malware cause bugs in web applications by tampering with the page as it loads or after it is running to inject ads or clean up other content. This may be happening to you, but without a complete sample or the ability to test on your machine, it will be hard to tell.
    Does it really matter? Ok, it happens on my machine on client side. We don't know exactly why.
    Evaluating the trigger at my machine would make it easier to reproduce this error. But is has to be fixed anyway, cause it could be triggered by any plugin my customers uses in his IE, too.

  10. #9
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,640
    Answers
    107
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    - sencha.com/examples is fine, since there are only 19 sheets in the mix.
    When testing sencha.com/examples, don't just load the page and assume it works - navigate to samples and try them to make them inject more css into the page as needed.

    - CSSResource is already set to pretty. All sheets seem to be from my applikation.
    How many <style> tags is that? As pointed out already, GWT will only create 30 at most, so if all of them are from the app, there can only be 30 at most? Clearly this doesn't jibe with the error message you are getting.

    It is something that should probably be filed and fixed in GWT, but if a browser plugin is adding dom elements and adding styles, no library can be fully bullet-proofed against those intrusions. If it were adding divs or spans into other elements (Skype used to (and may still) do this to make 'pretty' clickable phone numbers), the internals of widgets could be broken that don't expect the dom to change.

    I've got a tentative patch for GWT that corrects this oversight, but I'm working on a real test case. Any information you can provide about your current issue will help me to build that up.

  11. #10
    Sencha User
    Join Date
    Jul 2011
    Posts
    70
    Vote Rating
    5
    Andreas Samjeske is on a distinguished road

      0  

    Default


    Quote Originally Posted by Colin Alworth View Post
    When testing sencha.com/examples, don't just load the page and assume it works - navigate to samples and try them to make them inject more css into the page as needed.
    I did, but it seems like the IE Develepoer Tool fools me. Whenever I open it the first time after loading sencha.com/examples, it shows the correct number of css sheets. But this view gets never updated, even if I close and reopen dev tool (or click refresh on html tab).
    Anyway, I went to sencha.com/examples clicked around a bit and then opened dev tool. This way it showed me 30 files.

    Quote Originally Posted by Colin Alworth View Post
    How many <style> tags is that? As pointed out already, GWT will only create 30 at most, so if all of them are from the app, there can only be 30 at most? Clearly this doesn't jibe with the error message you are getting.
    My app shows initially 17 style tags plus 2 <link rel="stylesheet" ... > for reset.css and my.css.
    After Login I see 28 style tags plus 3 <link rel="stylesheet" ... > (chart.css is new). No error yet. I think, the 28th style got there after GWT finished its cycle.
    The very next action in my app leads to the error, since now GWT tries to make css adjustments, when there are 31 sheets for the first time.

    I discovered one sheet being
    Code:
    <style type="text/css">@media print {  .gmnoprint {    display:none  }}@media screen {  .gmnoscreen {    display:none  }}</style>
    This seems to got there cause I use Google Maps in my app.

    Quote Originally Posted by Colin Alworth View Post
    It is something that should probably be filed and fixed in GWT, but if a browser plugin is adding dom elements and adding styles, no library can be fully bullet-proofed against those intrusions. If it were adding divs or spans into other elements (Skype used to (and may still) do this to make 'pretty' clickable phone numbers), the internals of widgets could be broken that don't expect the dom to change.

    I've got a tentative patch for GWT that corrects this oversight, but I'm working on a real test case. Any information you can provide about your current issue will help me to build that up.
    Please file it at GWT issue tracker.
    Stepping through the code I discoevered another problem:
    Code:
              int len = styleSheetLengths[i];
              if (len == 0) {
                // Cache the length
                len = styleSheetLengths[i] = getDocumentStyleSheetLength(i);
              }
    While triing to find the shortest styleSheet, the lengths are being cashed in styleSheetLengths. Since GoogleMaps registered its styleSheet as the very first, styleSheetLengths is outdated since the index changed. The code above doesn't care. Therefore the style isn't getting to the shortest styleSheets.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar