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

Make QuickStartConfiguration check optional #9514

Closed
mvysny opened this issue Mar 17, 2023 · 3 comments
Closed

Make QuickStartConfiguration check optional #9514

mvysny opened this issue Mar 17, 2023 · 3 comments
Labels
Enhancement Stale For auto-closed stale issues and pull requests

Comments

@mvysny
Copy link

mvysny commented Mar 17, 2023

Jetty version(s)
11.0.14

Enhancement Description
It's possible to use Jetty with native and GraalVM when using Jetty QuickStart. Unfortunately, there's a check at QuickStartConfiguration:99 which always fails in native, with IllegalStateException("Bad Quickstart location").

The reason is as follows: the context.getBaseResource() needs to reference a resource directory packaged within the native image. The webroot is placed into classpath resource named /webapp. Te /webapp folder resolves to URL resource:/webapp which then resolves to plain URLResource (and not a JarResource since there's no URLClassLoader and no jars in native). Plain URLResource will always return false for the isDirectory() probe, hence the exception.

It would be good if the check could be turned off optionally, for example via a context attribute.

@mvysny
Copy link
Author

mvysny commented Mar 17, 2023

Steps to reproduce (I'm using Ubuntu 22.10):

  1. Install GraalVM as per https://graalvm.github.io/native-build-tools/latest/gradle-plugin-quickstart.html
  2. git clone https://github.com/mvysny/vaadin-boot-example-gradle
  3. git checkout native
  4. ./gradlew clean build nativeCompile -Pvaadin.productionMode
  5. cd build/native/nativeCompile/
  6. Run the vaadin-boot-example-gradle binary

You should see the following exception:

2023-03-16 13:32:47.747 [main] WARN org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@1da6646c{/,resource:/webapp,STOPPED}{resource:/webapp}
java.lang.IllegalStateException: Bad Quickstart location
	at org.eclipse.jetty.quickstart.QuickStartConfiguration.preConfigure(QuickStartConfiguration.java:95)
	at org.eclipse.jetty.webapp.Configurations.preConfigure(Configurations.java:496)
	at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:510)

Copy link

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Mar 17, 2024
Copy link

This issue has been closed due to it having no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Stale For auto-closed stale issues and pull requests
Projects
None yet
Development

No branches or pull requests

1 participant