0

I have a application built using GWT 2.4.0. Some time ago an issue has appeared, where for some users of Internet Explorer the application is not loading properly for the first time (only the static content is displayed). However, after using refresh (F5) the application reloads normally and works fine after that.

Some notes about the issue:

  • this issue is not present in Firefox;
  • this issue is present for specific users only and not everywhere. Even on the same desktop, if a different user logs in, the application works fine in IE. We also tried to log an user with this issue into another desktop - on another desktop there was no issue;
  • the issue has never been observed on the development machine - only by a few testers and some of the business users;
  • for those users who observe the issue, it happens 100% of the time (with no exceptions), since about 4 months ago;
  • when trying to capture network requests using IE's development tools, it shows that a certain *.cache.html file is always requested, but never gets found (HTTP 404). That file is not present in the compiled application, so it is unclear why it is requested at all. On refresh, this file is not requested, so the 404 error does not occur.;
  • IE9's development tools show Browser Mode: IE9 Compat View and Document Mode: IE7 standards.

What could be the problem? How could I precisely find out and fix the cause of the issue?

Haiku
  • 1
  • 5
  • Have you checked if first line of onModuleLoad is executed? If for some users the app work, it looks like a problem when logging (maybe a cookie, or sessionId problem). Is your app deployed under the same host on different ports? – apanizo May 07 '14 at 08:30
  • The code in onModuleLoad appears to be executing as usually, because it successfully adds certain version information to the main screen. The URL to the application does not have any ports in it. – Haiku May 07 '14 at 09:00
  • In that case, the problem is not in gwt. Check the process of login, or try to reproduce the error and set breakpoints in order to identify the step which causes the error, but probably is something related with login, becuase if it only fails for some users.... – apanizo May 07 '14 at 09:05
  • Are you caching sessions on the server? – apanizo May 07 '14 at 09:06
  • We've tried to log an user who was having the issue into another desktop, and there everything went fine. (Updated post to reflect this) – Haiku May 07 '14 at 14:35
  • When the issue is observed, there is also a script error saying "Access is denied" when trying to access GWT's history frame (in function com_google_gwt_user_client_impl_HistoryImplIE6_getTokenElement...). I am not sure if it is the cause or the effect of the above issue. – Haiku May 07 '14 at 14:39
  • Wait a second, which IE are you using? IE6? – apanizo May 07 '14 at 15:08
  • We're using IE9, and the report came from an user with IE8, so the issue has been observed in both of these. Definitely not IE6. – Haiku May 07 '14 at 16:00
  • Wow! Something similar to http://stackoverflow.com/questions/7566911/gwt-history-javascript-not-working-in-internet-explorer . I think we are seeing some kind of gwt's bug, because you are using the HistoryImplIE6 (which is for IE6 or 7) – apanizo May 07 '14 at 16:12

2 Answers2

0

Can you try to modify the History.gwt.xml, and remove the:

<!-- IE6 has a completely different history implementation. IE8 used the -->
<!-- standard implementation. -->
<replace-with class="com.google.gwt.user.client.impl.HistoryImplIE6">
  <when-type-is class="com.google.gwt.user.client.impl.HistoryImpl"/>
  <when-property-is name="user.agent" value="ie6"/>
</replace-with>

If you add this modified file with its namespace to your project, it should get the correct History implementation.

I do not understand why if you are in IE8 and IE9, your project pick HistoryImplIE6 up.

apanizo
  • 628
  • 5
  • 11
  • I've tried this, and strangely enough, this resolves the problem of the application not loading on initial startup. However, this breaks the navigation (which is done by changing the hash portion of the URL - like `#Search`, `#Preferences`, etc.), so something more needs to be done. – Haiku May 08 '14 at 10:17
  • Well, in that case the History implementation for your browser is not the correct one. There are something more out there. I have testing my app on browsers and the history works absolutely fine on IE8, IE9 and so on. Uninstall and install again IE, because that is the path to follow. Also you can debug the HistoryImpl and see where it breaks. Any stacktrace? – apanizo May 08 '14 at 10:32
  • There is no stacktrace, rather a client-side script error "Access is denied" when trying to access the history frame's document in the `HistoryImplIE6.getTokenElement()` method. It isn't clear why `HistoryImplIE6` is picked up - possibly something to do with the mode browser is in. When trying to explicitly set IE9 to be working in IE9 Browser mode and IE9 Standards mode, the application works fine on first try. – Haiku May 09 '14 at 09:11
  • So, if you use IE8 and IE9 under the correct mode, does your error disappear? – apanizo May 09 '14 at 09:50
  • Yes, where the error is observed, the error disappears when using the correct mode. – Haiku May 12 '14 at 07:56
  • So, the error is solved, right? Just tell to your clients use IE properly. Am I missing something? – apanizo May 12 '14 at 09:22
  • We wished for something that would work without making the clients perform special actions that are not part of their regular work. – Haiku May 14 '14 at 12:52
0

In the end, it appears to be some issue with Internet Explorer's caching. It seemed to retain some caches for the sites in Favorites. There were actually two solutions to this:

a) For the user, the fix was to delete the link from Favorites and then re-add the link.

b) In code, we added the following tag to our index.jsp to force IE9 into IE9 document mode, as per this question: <meta http-equiv="X-UA-Compatible" content="IE=9">

These solutions are independent and can be used one at a time, or both at once.

Community
  • 1
  • 1
Haiku
  • 1
  • 5