vertx-web
vertx-web copied to clipboard
vertx web deployed in spring boot, static resource can't be found in spring boot jar
Questions deployed vertx web in spring boot, review the static resource in vertx webroot, it can't be found with 404 error.
Version vertx.version > 4.0.0
Context I encountered an exception which looks suspicious while ...
Do you have a reproducer? springboot jar can be uploaded.
Link to github project/gist Steps to reproduce java -jar ./test-vertx.jar open web brower and input localhost:8080/hello.txt Extra JVM version 1.8
Resource not found
[Uploading test-vertx.jar.zip…] test-vertx.jar.zip ()
there is no issue when vertx version < 4.0.0
Can you rather share source code please? Thank you
OK
source code was attached.
The file seems to be stored in the jar under: /BOOT-INF/classes/webroot/ while we usually expect it under /webroot/. This is something related to spring class loaders i guess.
but it works when we used vert-web 3.0 before. the path /BOOT-INF/classes/ is defined by spring boot jar, so I think it should be the resource loaded logic was changed when using vert-web 4.0.
uploaded 3.0 working version.
the code is same only the version of vert-web is different.
the code is same only the version of vert-web is different.
Have you solved this problem? I also encountered this problem. The files in the resources directory cannot be obtained after being packaged
it looks like the issue https://github.com/eclipse-vertx/vert.x/issues/1623 which was fixed in https://github.com/eclipse-vertx/vert.x/pull/1624, but got cleaned out in the code clean, @vietj
@gaol So now the issue has been solved, right? By the way, which version should I use now?
@smwg not yet, please take a look at the PR: https://github.com/eclipse-vertx/vert.x/pull/4454, maybe you can try with that branch?
@gaol many thanks.
@gaol @pmlopes excuse me,In the latest version, does this bug still exist?
@smwg this should be fixed in 4.3.4
@smwg this should be fixed in 4.3.4
thanks