Xitrum does not serve static files anymore

26 views
Skip to first unread message

Joe

unread,
Mar 8, 2019, 9:23:20 AM3/8/19
to Xitrum web framework
Tried with Xitrum new project fresh downloaded on Win 10 and Debian:

Got:

[INFO] HTTP server started on port 8000
[INFO] HTTPS server started on port 4430
[INFO] Xitrum 3.28.15 started in development mode
[WARN] *** For security, change secureKey in config/xitrum.conf to your own! ***
[INFO] 0:0:0:0:0:0:0:1 GET / -> quickstart.action.SiteIndex -> 200, 22831 [ms]
[INFO] 0:0:0:0:0:0:0:1 GET /webjars/xitrum/3.28.15/xitrum.css?WeZg0rcDACGbqN_6cAf2jw -> 200 (JAR resource)
[INFO] 0:0:0:0:0:0:0:1 GET /webjars/bootstrap-css/3.3.6/css/bootstrap.css?W6N62RY2Q8MiUTZnVPCLKg -> 200 (JAR resource)
[INFO] 0:0:0:0:0:0:0:1 GET /app.css?7770790184219633591 -> quickstart.action.NotFoundError, queryParams: {7770790184219633591: } -> 404, 2445 [ms]
[INFO] 0:0:0:0:0:0:0:1 GET /favicon.ico?6018502014319075043 -> quickstart.action.NotFoundError, queryParams: {6018502014319075043: } -> 404, 142 [ms]
[INFO] 0:0:0:0:0:0:0:1 GET /whale.png?-6887168387166668424 -> quickstart.action.NotFoundError, queryParams: {-688716838716666...: } -> 404, 207 [ms]
[INFO] 0:0:0:0:0:0:0:1 GET /robots.txt -> quickstart.action.NotFoundError -> 404, 528 [ms]


on both machines.

takehar...@mobilus.co.jp

unread,
Mar 8, 2019, 10:24:00 AM3/8/19
to Xitrum web framework
You can try  `sbt fgRun`

When you use sbt fgRun
xitrum.root is your working directory 
like

/Users/oshida/Projects/tmp/xitrum-new


When you use sbt run
xtitrum.root become like

/var/folders/mk/pngkjv0s4gq9vr2bgjhq_xc40000gp/T/sbt_c9f842b3/target/dbed45b7

So xitrum can not find public directory.



2019年3月8日金曜日 23時23分20秒 UTC+9 Joe:

Ngoc Dao

unread,
Mar 9, 2019, 6:11:55 PM3/9/19
to Xitrum web framework
Yes, as Takeharu commented, you need to run with "sbt fgRun".

It's problem is caused by SBT 1.x change (with SBT 0.13.x, you can run with "sbt run"), see:
https://github.com/xitrum-framework/xitrum/issues/668

Ngoc Dao

unread,
Jun 3, 2019, 4:44:07 PM6/3/19
to Xitrum web framework
The command "sbt fgRun" is for running in development mode.

When you want to run in production mode (e.g. with Docker),
run "script/runner <main class>".

Source code of script/runner:

For more info:


On Wed, May 8, 2019 at 6:51 AM jvr <in...@jvr.de> wrote:

>
> ok tnx, but how can I achieve this if I have a fat jar generated by assembly sbt-plugin
>
> i.e.
>
>
> (Docker container)
>
>
> WORKDIR /app
>
> CMD ["java", "-jar", "/app/lib/xitrum-new-assembly-1.0-SNAPSHOT.jar"]
>
> mapping the public directory to/app/public
>
> i.e.
>
> docker run ... -v /path to public directory:/app/public
Reply all
Reply to author
Forward
0 new messages