I should also mention that I had to comment out the throwing of an exception in NPNServerConnectionFactory.
I had to remove line 58 "throw new IllegalStateException("NextProtoNego not on bootloader");" because when jetty is embedded in a parent server/container, npn is loaded and NextProtoNego.class.getClassLoader() evaluates to to true instead of null.
I then tried to write my own system classloader and load the npn jar as a URLClassLoader with something like:
JarFile jarFile = new JarFile(pathToJar);
URL[] urls = { new URL("jar:file:" + pathToJar+"!/") };
URLClassLoader cl = new URLClassLoader(urls, context.getClassLoader().getSystemClassLoader());
context.setClassLoader(cl);
but there is no way to set the classloader on context.getClassLoader().getSystemClassLoader().
I know this might be getting into weeds that I don't need to venture into at all. But like I said in my first post, the npn jar is loaded in the parent server before jetty is started. So I'm not sure if it is getting loaded properly when embedded starts - but I see no errors.