-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undertow: servletContext.getResourcePaths("/") not listed in PROD mode #28028
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@melloware not sure how you arrived at my name as I haven't done much in Undertow, but I could take a look once I am back from X-mass break. I am unlikely to know though as I am unfamiliar with UT codebase :-) |
This comment was marked as off-topic.
This comment was marked as off-topic.
No problem. Like I said, I can take a look once I am operational again. |
I believe that the problem lies in the DirectoryResource#list() method. It returns an empty list because the @stuartwdouglas could you pls take a look sometime next year ;-) |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@stuartwdouglas I finally got to the bottom of this but have no idea how to fix it. I debugged the code in production mode and its finding the resource correctly using Resource: Undertow Code: https://github.com/undertow-io/undertow/blob/master/servlet/src/main/java/io/undertow/servlet/spec/ServletContextImpl.java#L278 Here is that line in the debugger: So basically a URL resource |
Fails for me on Windows (build and deploy to Ubuntu server). |
circling back to this i don't think @gsmet fix fixes this particular issue. I think this code needs to be modified to look in JAR or File Path like FlyWay does like this using ClassPathUtils.consumeAsPaths(Thread.currentThread().getContextClassLoader(), location, path -> {
Set<String> applicationMigrations = null;
try {
applicationMigrations = FlywayProcessor.this.getApplicationMigrationsFromPath(finalLocation, path);
} catch (IOException e) {
LOGGER.warnv(e,
"Can't process files in path %s", path);
}
if (applicationMigrations != null) {
applicationMigrationResources.addAll(applicationMigrations);
}
}); |
Found the same issue, which breaks Faces AUTOMATIC_EXTENSIONLESS_MAPPING |
Describe the bug
I have a simple ApplicationInitializer to print out all the available servlet resource paths...
When running in DEV mode
mvn quarkus:dev
the following is printed out it finds the mapped/index.html
:When running in PRD mode
mvn clean package -DskipTests && java -jar target/quarkus-app/quarkus-run.jar
it doesn't find anything:Expected behavior
All servlet resource paths should be available in both DEV and PRD mode.
Actual behavior
Resource Paths are only available in DEV mode.
How to Reproduce?
quarkus-servlet.zip
mvn clean quarkus:dev
and see the servlet paths printed out2022-12-27 13:00:20,489 INFO [org.acm.ApplicationInitializer] (Quarkus Main Thread) Resource: /index.html
mvn clean package -DskipTests && java -jar target/quarkus-app/quarkus-run.jar
and see the WARNING that no paths found2022-12-27 13:01:06,297 WARNING [org.acm.ApplicationInitializer] (main) NO servlet resource paths found!
Output of
uname -a
orver
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Output of
java -version
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.15.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0) Maven home: C:\Tools\apache-maven-3.8.5 Java version: 11.0.10, vendor: AdoptOpenJDK, runtime: C:\Tools\jdk-11.0.10 Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional information
No response
The text was updated successfully, but these errors were encountered: