Skip to content
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

Fix servlet file listing #30527

Closed
wants to merge 2 commits into from
Closed

Conversation

stuartwdouglas
Copy link
Member

Fixes #28028

@quarkus-bot

This comment has been minimized.

@geoand
Copy link
Contributor

geoand commented Jan 26, 2023

The windows failure of the test seems relevant

@stuartwdouglas
Copy link
Member Author

Yea, something is going on there. underlying.getResource() must be returning null, although I am not sure why at this point.

@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jan 30, 2023
@quarkus-bot

This comment has been minimized.

@geoand
Copy link
Contributor

geoand commented Jan 30, 2023

Gotta love Windows...

java.lang.RuntimeException: Unable to get listed resource foo\bar\bar.html from directory  for path  from underlying manager io.undertow.server.handlers.resource.ClassPathResourceManager@8843d9
2023-01-30T05:55:21.6413585Z 	at io.quarkus.undertow.runtime.KnownPathResourceManager$DirectoryResource.list(KnownPathResourceManager.java:137)
2023-01-30T05:55:21.6414290Z 	at io.undertow.servlet.spec.ServletContextImpl.getResourcePaths(ServletContextImpl.java:272)
2023-01-30T05:55:21.6414905Z 	at io.quarkus.undertow.test.ResourceManagerTestCase$ContextPathServlet.doGet(ResourceManagerTestCase.java:53)
2023-01-30T05:55:21.6415429Z 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
2023-01-30T05:55:21.6415825Z 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
2023-01-30T05:55:21.6416312Z 	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
2023-01-30T05:55:21.6416987Z 	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:63)
2023-01-30T05:55:21.6417628Z 	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
2023-01-30T05:55:21.6418209Z 	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
2023-01-30T05:55:21.6418854Z 	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:67)
2023-01-30T05:55:21.6419600Z 	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:133)
2023-01-30T05:55:21.6420479Z 	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
2023-01-30T05:55:21.6421186Z 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2023-01-30T05:55:21.6421862Z 	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
2023-01-30T05:55:21.6422747Z 	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:65)
2023-01-30T05:55:21.6423643Z 	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
2023-01-30T05:55:21.6424465Z 	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
2023-01-30T05:55:21.6425269Z 	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
2023-01-30T05:55:21.6426109Z 	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
2023-01-30T05:55:21.6426859Z 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2023-01-30T05:55:21.6427402Z 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
2023-01-30T05:55:21.6428081Z 	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:247)
2023-01-30T05:55:21.6428723Z 	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:56)
2023-01-30T05:55:21.6429291Z 	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:111)
2023-01-30T05:55:21.6429817Z 	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:108)
2023-01-30T05:55:21.6430464Z 	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
2023-01-30T05:55:21.6431151Z 	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
2023-01-30T05:55:21.6431755Z 	at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$9$1.call(UndertowDeploymentRecorder.java:595)
2023-01-30T05:55:21.6432385Z 	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
2023-01-30T05:55:21.6433037Z 	at io.undertow.servlet.handlers.ServletInitialHandler.handleRequest(ServletInitialHandler.java:152)
2023-01-30T05:55:21.6433674Z 	at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$1.handleRequest(UndertowDeploymentRecorder.java:120)
2023-01-30T05:55:21.6434200Z 	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:284)
2023-01-30T05:55:21.6434749Z 	at io.undertow.server.DefaultExchangeHandler.handle(DefaultExchangeHandler.java:18)
2023-01-30T05:55:21.6435310Z 	at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$5$1.run(UndertowDeploymentRecorder.java:417)
2023-01-30T05:55:21.6435839Z 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
2023-01-30T05:55:21.6436297Z 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2023-01-30T05:55:21.6436769Z 	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
2023-01-30T05:55:21.6437273Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2023-01-30T05:55:21.6437759Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2023-01-30T05:55:21.6438248Z 	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
2023-01-30T05:55:21.6438764Z 	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
2023-01-30T05:55:21.6439329Z 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2023-01-30T05:55:21.6439739Z 	at java.base/java.lang.Thread.run(Thread.java:829)
2023-01-30T05:55:21.6439923Z 

@gsmet gsmet removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jan 30, 2023
@stuartwdouglas
Copy link
Member Author

I think quarkusio/quarkus-http#111 should be the fix.

@melloware

This comment was marked as outdated.

@gsmet gsmet added the triage/needs-rebase This PR needs to be rebased first because it has merge conflicts label Feb 4, 2023
@melloware

This comment was marked as outdated.

@stuartwdouglas stuartwdouglas removed the triage/needs-rebase This PR needs to be rebased first because it has merge conflicts label Feb 15, 2023
@gastaldi gastaldi added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 15, 2023
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@melloware

This comment was marked as outdated.

@quarkus-bot

This comment has been minimized.

@stuartwdouglas
Copy link
Member Author

Looks like there is still an issue, I will need to have another look when I have time.

@melloware
Copy link
Contributor

Bump one more time?

@melloware
Copy link
Contributor

@stuartwdouglas now that 3.0.0 Final is out maybe one more look at this one?

@stuartwdouglas
Copy link
Member Author

I don't have access to windows which makes it hard to debug. It is almost certainly a / vs \ issue somewhere in the resource handling code.

@quarkus-bot

This comment has been minimized.

@melloware
Copy link
Contributor

OK I run on Windows let me try your code and see if I can figure out the error.

@melloware
Copy link
Contributor

OK I don't see how this would work.

image

Its looking for Windows "foo\bar\bar.html" but the underlying ClassPathResourceManager it has Unix prefix `META-INF/resources/"

If I correct the slashes to be UNix slashes it no longer errors but then returns too many files

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 14, 2023

Failing Jobs - Building 537cc41

Status Name Step Failures Logs Raw logs
✔️ JVM Tests - JDK 11
✔️ JVM Tests - JDK 17
JVM Tests - JDK 17 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 19
Native Tests - Misc1 Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 17 Windows #

- Failing: extensions/undertow/deployment 
! Skipped: extensions/agroal/deployment extensions/cache/deployment extensions/config-yaml/deployment and 197 more

📦 extensions/undertow/deployment

io.quarkus.undertow.test.ResourceManagerTestCase.testServlet line 38 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

⚙️ Native Tests - Misc1 #

- Failing: integration-tests/qute 

📦 integration-tests/qute

Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:build (default) on project quarkus-integration-test-qute: Failed to build quarkus application

@melloware
Copy link
Contributor

I submitted my PR based on this one if someone wants to kick off the build so I can see whether it passes on Windows and Linux now. I did all my testing on Windows and its all working.

#32656

@gastaldi
Copy link
Contributor

Superseded by #32656

@gastaldi gastaldi closed this Apr 18, 2023
@quarkus-bot quarkus-bot bot added triage/invalid This doesn't seem right and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/undertow triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undertow: servletContext.getResourcePaths("/") not listed in PROD mode
5 participants