Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » InteliJ Hello World Production Error 404
InteliJ Hello World Production Error 404 [message #1844263] Tue, 07 September 2021 15:04 Go to next message
Luis Nothvogel is currently offline Luis NothvogelFriend
Messages: 56
Registered: October 2019
Member
Hi all,

I created a new Project in Intelij with the newest Scout plugin. But when i change the devMode to false, and build and start the application i get an Error 404 on the login.html.

But as far as I can see it, everything is as it should be.

Can someone help?

The first screenshot is from the target folder, the second one is from the file-list

Scout-Version: 11
Plugin-Version: 11.0.0.2109061514
Re: InteliJ Hello World Production Error 404 [message #1844264 is a reply to message #1844263] Tue, 07 September 2021 15:09 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Luis

Its a feature of the devMode that the files are automatically built (via npm/webpack watchers) and read from the filesystem. In live mode file loading works differently. Files are expected to be on the classpath. Testing live mode on your dev machine is possible, but requires to run the build manually and copy the files to the right place.

Claudio explained that here: https://www.eclipse.org/forums/index.php/m/1823435/?srch=devMode#msg_1823435

Cheers
André


Eclipse Scout Homepage | Documentation | GitHub
Re: InteliJ Hello World Production Error 404 [message #1844265 is a reply to message #1844263] Tue, 07 September 2021 15:16 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior Member
Hi Luis

In dev mode Scout loads web assets (html, js, css) from the output of the javascript dev build (npm script "build:dev"). This is the same when using the js watcher (npm script "build:dev:watch"). The output directory in these cases is "target/dist/dev" below your npm module.

If you change devMode to false Scout will no longer load web assets from the dev output but from the prod output instead. The directory is "target/dist/prod". So maybe there is no content in this directory?
If this is the case you might need to launch the production javascript build (npm script "build:prod"). This build creates prod output which should then be found by Scout having devMode=false.

prod output is minified while dev output is not for easier debugging. Scout uses different output folders so that at runtime the web assets used can be switched e.g. using the debug=true url parameter.

Does this help?

Kind regards
Mat
Re: InteliJ Hello World Production Error 404 [message #1844270 is a reply to message #1844265] Tue, 07 September 2021 15:58 Go to previous messageGo to next message
Luis Nothvogel is currently offline Luis NothvogelFriend
Messages: 56
Registered: October 2019
Member
Thanks to both of you :)
I didnt know that i had to move the files to target/classes folder. I thought that building with the pnpm run buil:prod would be enough.

Thanks for the very fast help as always :)
Re: InteliJ Hello World Production Error 404 [message #1844350 is a reply to message #1844270] Fri, 10 September 2021 12:16 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior Member
Hi Luis

You actually don't need to copy the resources to target/classes manually.
Scout decides based on property "scout.loadWebResourcesFromFilesystem" if web resources should be loaded from filesystem or classpath.

By default the property has the same value as scout.devMode.
But after setting "scout.devMode=false" you can also set "scout.loadWebResourcesFromFilesystem=true".

Then you only need to execute the npm prod build and it should work without copying anything.

Kind regards
Mat
Re: InteliJ Hello World Production Error 404 [message #1844503 is a reply to message #1844350] Wed, 15 September 2021 11:17 Go to previous message
Luis Nothvogel is currently offline Luis NothvogelFriend
Messages: 56
Registered: October 2019
Member
Thank you Matthias, awesome suggestion! :)
Previous Topic:IntelliJ Plugin in IntelliJ 2021.2.X
Next Topic:How to display an image from data base into a HTML Field
Goto Forum:
  


Current Time: Sun Apr 14 05:01:28 GMT 2024

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

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

Back to the top