There seems to be an issue with the dependencies of Jetty 10 in the starter. Trying to use the current latest 10.0.5 and h2c (probably the only reason to use 10?) results in a ClassNotFoundException due to jetty.http2 dependencies being missing.

Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/http2/server/HTTP2CServerConnectionFactory
        at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.createConnector(JettyServletWebServerFactory.java:186) ~[spring-boot-2.5.1.jar:2.5.1]
        at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.createServer(JettyServletWebServerFactory.java:175) ~[spring-boot-2.5.1.jar:2.5.1]
        at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getWebServer(JettyServletWebServerFactory.java:152) ~[spring-boot-2.5.1.jar:2.5.1]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) ~[spring-boot-2.5.1.jar:2.5.1]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ~[spring-boot-2.5.1.jar:2.5.1]
        ... 8 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
        ... 13 common frames omitted

I ignore what's the best approach to fix this, so I'm not even attempting a pull request.

Sample project attached. jetty10.zip

Comment From: Alok255

As for the java.lang.ClassNotFoundException, you'll need to fix your dependencies first. If the problem still persists after fixing your dependencies, consider posting how you create your classloaders, their hierarchy, and how you use XmlConfiguration (and from which classloader).

Comment From: wilkinsona

The documentation on using HTTP/2 with Jetty says the following:

For HTTP/2 support, Jetty requires the additional org.eclipse.jetty.http2:http2-server dependency. To use h2c no other dependencies are required.

Your sample does not depend on http2-server. Adding the required dependency allows your application to start:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.1)

2021-06-20 16:58:41.003  INFO 71252 --- [           main] foo.Application                          : Starting Application using Java 11.0.10 on wilkinsona-a01.vmware.com with PID 71252 (/Users/awilkinson/Downloads/jetty10/build/classes/java/main started by awilkinson in /Users/awilkinson/Downloads/jetty10)
2021-06-20 16:58:41.004  INFO 71252 --- [           main] foo.Application                          : No active profile set, falling back to default profiles: default
2021-06-20 16:58:41.446  INFO 71252 --- [           main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8443
2021-06-20 16:58:41.447  INFO 71252 --- [           main] org.eclipse.jetty.server.Server          : jetty-10.0.5; built: 2021-06-11T14:18:43.438Z; git: dc21b2d73cafd78a56e8e532cf50863739bd7027; jvm 11.0.10+9
2021-06-20 16:58:41.487  INFO 71252 --- [           main] o.e.j.s.h.ContextHandler.application     : Initializing Spring embedded WebApplicationContext
2021-06-20 16:58:41.487  INFO 71252 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 455 ms
2021-06-20 16:58:41.501  INFO 71252 --- [           main] o.e.j.s.session.DefaultSessionIdManager  : Session workerName=node0
2021-06-20 16:58:41.508  INFO 71252 --- [           main] o.e.jetty.server.handler.ContextHandler  : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@39ad12b6{application,/,[file:///private/var/folders/2w/mhq2nt4d0xx2w6w4c36n468h0000gn/T/jetty-docbase.8443.7756197861216668605/],AVAILABLE}
2021-06-20 16:58:41.509  INFO 71252 --- [           main] org.eclipse.jetty.server.Server          : Started Server@376e7531{STARTING}[10.0.5,sto=0] @1042ms
2021-06-20 16:58:41.659  INFO 71252 --- [           main] o.e.j.s.h.ContextHandler.application     : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-06-20 16:58:41.660  INFO 71252 --- [           main] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2021-06-20 16:58:41.660  INFO 71252 --- [           main] o.s.web.servlet.DispatcherServlet        : Completed initialization in 0 ms
2021-06-20 16:58:41.676  INFO 71252 --- [           main] o.e.jetty.server.AbstractConnector       : Started ServerConnector@2f61f937{HTTP/1.1, (http/1.1, h2c)}{0.0.0.0:8443}
2021-06-20 16:58:41.677  INFO 71252 --- [           main] o.s.b.web.embedded.jetty.JettyWebServer  : Jetty started on port(s) 8443 (http/1.1, h2c) with context path '/'
2021-06-20 16:58:41.684  INFO 71252 --- [           main] foo.Application                          : Started Application in 0.949 seconds (JVM running for 1.217)

It can also successfully upgrade to h2c:

$ curl --http2 -v localhost:8443
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8443 (#0)
> GET / HTTP/1.1
> Host: localhost:8443
> User-Agent: curl/7.64.1
> Accept: */*
> Connection: Upgrade, HTTP2-Settings
> Upgrade: h2c
> HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA
> 
< HTTP/1.1 101 Switching Protocols
< Upgrade: h2c
< Connection: Upgrade
* Received 101
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 404 
< cache-control: must-revalidate,no-cache,no-store
< content-type: application/json
< 
* Connection #0 to host localhost left intact
{"timestamp":"2021-06-20T15:59:25.591+00:00","status":404,"error":"Not Found","path":"/"}* Closing connection 0

FWIW, there's no need to use Jetty 10 to use h2c. It works fine with Jetty 9.4.

Comment From: hectorlf

Ah, thanks, missed that part. The upgrade notes for 2.5 are a bit light on details, but the docs are ok.

Comment From: philwebb

@hectorlf I’ve added some additional text to the release notes that should hopefully provide some breadcrumbs for anyone else that faces this issue.

Comment From: hectorlf

Thank you very much!