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

ServletContextInitializer IT test #33018

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Conversation

melloware
Copy link
Contributor

Test case for #28028 just to see if it fails in Native mode

@melloware
Copy link
Contributor Author

@gastaldi can you kick off this workflow I want to see if this IT fails or not in Native mode . I think this emulates my real world test case.

@gastaldi
Copy link
Contributor

gastaldi commented Apr 30, 2023

Done, btw you can also check the workflow running in your own branch if you enable it 😉

@melloware
Copy link
Contributor Author

Oh whoah how do I do that. a setting in my fork?

@melloware
Copy link
Contributor Author

Nevermind I think I found the setting!

@quarkus-bot

This comment has been minimized.

@melloware
Copy link
Contributor Author

OK @stuartwdouglas something is different about how the unit tests run vs a real world app.

If you run this real world app which does the exact same as the Integration test above fails and throws the RunTimeException.

Reproducer:
quarkus-servlet.zip

Run mvn clean package -DskipTests && java -jar target/quarkus-app/quarkus-run.jar and you get...

2023-04-30 11:54:27,884 INFO  [org.acme.ApplicationInitializer] (main) Checking servlet resource paths...

2023-04-30 11:54:27,899 DEBUG [io.quarkus.arc.impl] (main) ArC DI container shut down

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:61)
        at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32)
Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
        ... 6 more
Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
        ... 15 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: NO servlet resource paths found!
        at io.quarkus.undertow.runtime.UndertowDeploymentRecorder.bootServletContainer(UndertowDeploymentRecorder.java:554)
        at io.quarkus.deployment.steps.UndertowBuildStep$build767851419.deploy_0(Unknown Source)
        at io.quarkus.deployment.steps.UndertowBuildStep$build767851419.deploy(Unknown Source)
        ... 16 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: NO servlet resource paths found!
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:253)
        at io.quarkus.undertow.runtime.UndertowDeploymentRecorder.bootServletContainer(UndertowDeploymentRecorder.java:543)
        ... 18 more
Caused by: java.lang.RuntimeException: NO servlet resource paths found!
        at org.acme.ApplicationInitializer.onStartup(ApplicationInitializer.java:28)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:204)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:186)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at io.quarkus.undertow.runtime.UndertowDeploymentRecorder$9$1.call(UndertowDeploymentRecorder.java:602)
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:251)
        ... 19 more

@melloware
Copy link
Contributor Author

I have confirmed that bug #28028 still exists and even though this IT is attempting to replicate it it seems to work but a real life scenario does not work.

@melloware melloware marked this pull request as ready for review October 14, 2024 18:18

This comment has been minimized.

@gastaldi gastaldi added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 14, 2024
Copy link

quarkus-bot bot commented Oct 14, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit a317089.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@melloware
Copy link
Contributor Author

@gsmet i think you fixed this bug!

@gastaldi gastaldi merged commit b51b778 into quarkusio:main Oct 14, 2024
35 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 14, 2024
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Oct 14, 2024
@melloware melloware deleted the 32724-it branch October 14, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants