Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Migration from Scout 10 to 22
Migration from Scout 10 to 22 [message #1851167] Tue, 29 March 2022 11:44 Go to next message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Good day,

Thank you very much and congratulations on the release of Scout 22!!!

I have followed the migration steps for release 11 and 22 but when I put the scout.devMode=true then the application just shows a blank screen even though all the java script and css files loads without an error.

I have tried performing a clean build and even created a demo project for release 22 so that I can compare that all the settings and migration steps were completed correctly but I still have not found why the application will just show a blank screen.

Kind regards,
Mark Ashworth
Re: Migration from Scout 10 to 22 [message #1851170 is a reply to message #1851167] Tue, 29 March 2022 12:03 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 255
Registered: March 2010
Senior Member
Hi Mark,

is there any error shown in the browser console? Press F12 to open the dev tools and then reload the page.

Does your index.html use the <scout:scripts> tag referring the entry point or does it include the scripts explicitly using <scout:script>? See also Migration Guide 11. Using the dev tools network panel, you can also check whether the scripts included in the actual index.html returned by your server are really loaded by the browser.
Re: Migration from Scout 10 to 22 [message #1851172 is a reply to message #1851170] Tue, 29 March 2022 12:28 Go to previous messageGo to next message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Good day,

Thank you for getting back to me.

The index.html file uses the scout:scripts and scout:stylesheets tag.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Clear Insights</title>
    <scout:include template="includes/head.html" />
    <scout:stylesheets entrypoint="clearinsights-theme"/>
  </head>
  <body>
    <scout:include template="includes/no-script.html" />
    <div class="scout" data-partid="1"></div>
    <scout:version />
    <scout:scripts entrypoint="clearinsights"/>
  </body>
</html>


These are configured in the webpack.js file

const baseConfig = require('@eclipse-scout/cli/scripts/webpack-defaults');

module.exports = (env, args) => {
  args.resDirArray = ['src/main/resources/WebContent', 'node_modules/@eclipse-scout/core/res'];
  const config = baseConfig(env, args);

  config.entry = {
    'clearinsights':            './src/main/js/clearinsights.js',
    'login':                    './src/main/js/login.js',
    'logout':                   './src/main/js/logout.js',
    'clearinsights-theme':      './src/main/js/clearinsights-theme.less'
  };

  return config;
};


I have also updated the exclude filter
<init-param>
    <param-name>filter-exclude</param-name>
    <param-value>
        /favicon/*
        /fonts/*
        /*logo*.png
        /*login*.js
        /*logout*.js
        /*clearinsights*.js
        /*clearinsights-theme*.css
    </param-value>
</init-param>


Attached is the Dev Tools output showing that the scripts and stylesheet resources are resolved.

I have noticed that the 'defaultValues' request is returning with an error that the session has expired but if I refresh then the screen and 'defaultValues' remain the same.

Kind regards,
Mark Ashworth
Re: Migration from Scout 10 to 22 [message #1851176 is a reply to message #1851172] Tue, 29 March 2022 12:55 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 255
Registered: March 2010
Senior Member
You are writing that you set scout.devMode=true, but your screenshot shows minified files which should only be created and loaded in prod mode. So, are you actually trying to set scout.devMode to false? If yes, have you run the prod build before and copied the output to target/classes resp. set scout.loadWebResourcesFromFilesystem=true?
See also test-prod-scripts-on-your-local-machine
Re: Migration from Scout 10 to 22 [message #1851178 is a reply to message #1851176] Tue, 29 March 2022 13:58 Go to previous messageGo to next message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Hi Claudio,

Apologies, you are 100% correct. I am trying to set scout.devMode=false so that I can test the login screen on my local development machine. It also shows a blank screen when I deploy the application using the web archive.

I run the 'webapp all.launch' which runs the pnpm scripts and starts the dev & ui server in debug mode.

I tried the /?debug=false and the scout.loadWebResourcesFromFilesystem=true in the link that you shared. Unfortunately this did not work.

The issue seems to be happening in the UiServletFilter class when it forwards to the login form.

BEANS.get(ServletFilterHelper.class).forwardToLoginForm(req, resp);


When I put a breakpoint in the ServletFilterHelper on the acceptForwardOrRedirect method, I notice that I get 3 forward requests

1. The first forward request is for '/'
2. The second forward request is for '/login.html'
3. The third forward request is for '/defaultValues'.

When forward request number 3 is encountered, ServletFilterHelper responds with the following JSON reply

{"error":{"code":10,"message":"The session has expired, please reload the page."}}


It seems that is where the processing stops and a blank screen is shown.

Here is the logging for the ui.html.app.dev project

2022-03-29 16:53:56,533 DEBUG [qtp844112759-54] org.eclipse.scout.rt.server.commons.authentication.ServletFilterHelper.forwardOrRedirectTo(ServletFilterHelper.java:327) - Forwarding '/' to '/login.html' - MDC[]
2022-03-29 16:53:57,185 DEBUG [qtp844112759-56] org.eclipse.scout.rt.server.commons.authentication.ServletFilterHelper.forwardOrRedirectTo(ServletFilterHelper.java:327) - Forwarding '/clearinsights-7c0d7c231bea0cae83d7.min.js.map' to '/login.html' - MDC[]
2022-03-29 16:53:57,524 DEBUG [qtp844112759-57] org.eclipse.scout.rt.server.commons.authentication.ServletFilterHelper.forwardOrRedirectTo(ServletFilterHelper.java:327) - Forwarding '/vendors~clearinsights-de96191dbf85e88095d6.min.js.map' to '/login.html' - MDC[]
2022-03-29 16:53:57,535 DEBUG [qtp844112759-55] org.eclipse.scout.rt.server.commons.authentication.ServletFilterHelper.forwardOrRedirectTo(ServletFilterHelper.java:327) - Forwarding '/vendors~clearinsights~login~logout-729d8cc8ebdb75ab5d49.min.js.map' to '/login.html' - MDC[]
2022-03-29 16:53:57,777 DEBUG [qtp844112759-54] org.eclipse.scout.rt.server.commons.authentication.ServletFilterHelper.acceptForwardOrRedirect(ServletFilterHelper.java:345) - Returning session timeout error as json for path /defaultValues, based on Accept header application/json, text/javascript, */*; q=0.01. - MDC[]


On my sample project that I created directly for version 22 and the scout.devMode=false, the last log entry for for the '/defaultValues' is not present and the login screen is shown.


Kind regards,
Mark Ashworth







[Updated on: Tue, 29 March 2022 14:58]

Report message to a moderator

Re: Migration from Scout 10 to 22 [message #1851180 is a reply to message #1851178] Tue, 29 March 2022 15:07 Go to previous message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Hi Claudio,

Apologies for raising the issue.

After looking at the files once again, I noticed that I had the entry points incorrect for the login.html and logout.html files. These needed to be 'login' and 'logout' respectively instead of 'clearinsights'.

Thank you very much for your assistance.

Kind regards,
Mark Ashworth
Previous Topic:Error deserialising blacklisted class `javax.management.Notification`
Next Topic:Working with Tile view in Table
Goto Forum:
  


Current Time: Wed Feb 28 16:35:37 GMT 2024

Powered by FUDForum. Page generated in 0.02816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top