The GWT application hangs on the loading screen

201 views
Skip to first unread message

Antonio Capone

unread,
Jan 11, 2024, 4:56:55 AMJan 11
to GWT Users
Hi all. I deployed an app using GWT on Cloud. It's deployed and working, but when you log in, the browser window just says "Loading" and seems to hang indefinitely. Works fine locally in Eclipse.
Has this ever happened to you? Is there anyone who can help me understand why this happens?
Many thanks

Frank Hossfeld

unread,
Jan 11, 2024, 8:42:14 AMJan 11
to GWT Users
Check if the nochache.js gets loaded at a applicaiton staert or if it got a 404. In this case something with the URI is not ok.

Jeff Hill

unread,
Jan 12, 2024, 10:54:08 AMJan 12
to GWT Users
There may have been some Chrome updates in the last few months; occasionally, I must hard refresh to get the latest code from nocache.js.  (That did not happen in  years past)

Anyway, I always check in Developer Tools in Chrome to make sure there are no errors in the "Console" and all the necessary files are being loaded in the "Network" tab.

Craig Mitchell

unread,
Jan 13, 2024, 11:39:07 PMJan 13
to GWT Users
I use a servlet filter to tell the browser not to cache the nocache files:

public class ServletFilter implements Filter {
  private static final String NO_CACHE = ".nocache.js";

  @Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    String requestURI = ((HttpServletRequest)request).getRequestURI();

    // Don't cache the nocache
    if (requestURI.endsWith(NO_CACHE)) {
      setNoCache((HttpServletResponse)response);
    }
    chain.doFilter(request, response);
  }

  private void setNoCache(HttpServletResponse httpResponse) {
    Date now = new Date();
    httpResponse.setDateHeader("Date", now.getTime());
    httpResponse.setDateHeader("Expires", now.getTime() - 86400000L);
    httpResponse.setHeader("Pragma", "no-cache");
    httpResponse.setHeader("cache-control", "public, max-age=0, must-revalidate");
  }
}

Antonio Capone

unread,
Jan 15, 2024, 3:53:58 AMJan 15
to GWT Users
Hello everyone and thanks for the advice you are giving me.
The nocache.js file is regularly generated and loaded. I don't think I have a problem with the URI because I can also see the home page grid but nothing more. No errors appear in the developer tool. Note that I upgraded from GWT 2.1 to GWT 2.7 and before that I had no problems.
Can you give me some other suggestions?
Thanks again.

Frank Hossfeld

unread,
Jan 15, 2024, 9:15:56 AMJan 15
to GWT Users
Did you check in the Developer Tools ->. Network if the nochache.js gets loaded?

Antonio Capone

unread,
Jan 17, 2024, 12:16:54 PMJan 17
to GWT Users
 Hi Frank, thanks for the support.
No errors appear in the application logs of the application nor in the Develop Tool. The nocache.js file is successfully loaded. What else could it be?

Regrds

Jeff Hill

unread,
Jan 17, 2024, 12:28:04 PMJan 17
to GWT Users
There might be an error in the actual code of the app (exception or other).

I suggest you try some primitive debugging with a Window.alert message as the first line of your onModuleLoad method.

ie...
 @Override
public void onModuleLoad() {

Window.alert("App is starting");

Antonio Capone

unread,
Jan 19, 2024, 10:53:24 AMJan 19
to GWT Users
Hi Jeff, all,
your advice was very helpful to me, thanks a lot.

I put an alert message at the first line of your onModuleLoad method.
I put 3 more alert message in the entrypoint classes defined within the 3 gwt.xml files. I did this work first locally, where the project goes up without problems and then I deployed the war on the cloud.
Locally the 3 warning messages inform me that the 3 entrypoint classes are called. But this does not happen in the distributed application. Only the MyWorkspace class containing the  onModuleLoad()  method is called and then it enters a sort of loop, always loading the same class and never the 3 entrypoint classes.
Please, do you know why this happens?
This is all happening following an upgrade from GWT 1.5 to GWT 2.7.0, with jdk 1.8.

Thanks in advance,
Antonio
Reply all
Reply to author
Forward
0 new messages