Open mvysny opened 3 years ago
The problem is in fundamentally broken code in DevModeInitializer
which tries to use DeploymentConfiguration
when there is no any DeploymentConfiguration
: deployment configuration is intended to be used for a servlet. DevModeInitializer
is invoked before any other initialization and it may not expect that there are some servlets at all.
(and if there are several servlets then whose DeploymentConfiguration
to use ?).
DevModeInitializer.isVaadinServletSubClass
is used to find the Vaadin servlet to get its DeploymentConfiguration
.
It's absolutely wrong to use DeploymentConfiguration
in any ServletContextListener
.
The only config which can be available in the ServletContextListener
is an application configuration.
There is no any application configuration in V14 (and may be never be).
But this is already properly done in the master
: Flow 6.0
.
If you are able to use V19/Flow 6.0 then please use it and there should not be the issue at all.
Thank you ;) Yeah I've already took advantage of the com.vaadin.flow.di.ResourceProvider
and implemented my own QuarkusResourceProvider
which uses Thread.currentThread().getContextClassLoader()
to load flow-build-info.json
properly - excellent work! (sorry - not really related to this ticket; BUT using custom ResourceProvider fixes the original issue vaadin/flow#9713, which causes no need for a custom servlet, which renders this ticket unnecessary).
Unfortunately this kind of solution is not applicable to Vaadin 14 (since there is nothing similar to Lookup
). Any chance of a backport of Lookup
/ResourceProvider
to Vaadin 14?
Lookup
is only in the master
.
The changes related to Lookup
impl and usage are quite breaking.
I don't think they will be backported to the v14.......
At least I have no intention to do this.
But you may create a ticket about this: let's redirect this question to the decision makers.
Description of the bug / feature
Using custom servlet in a Quarkus+Vaadin app causes
DevModeInitializer
to fail with ClassNotFoundException.The reason is that Quarkus uses multiple classloaders; it loads Vaadin jars in one classloader and the app code (including the Servlet class) in another classloader. The "Vaadin classloader" is then unable to load the Servlet class.
The exception stacktrace follows:
Minimal reproducible example
Please see the attached app.
vaadin-quarkus.zip
mvn -C clean package quarkus:dev
Expected behavior
Vaadin should use Thread's context class loader to load the classes
Actual behavior
Vaadin uses
Class.forName()
which usesDevModeInitializer.class.getClassLoader()
.Versions: