You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vaadin's ServletDeployer is apparently not being called, and therefore the default VaadinServlet isn't being configured automatically if the app doesn't provide one.
The problem apparently is that Tomcat doesn't perform a full classpath scanning. Vaadin-Boot forces Tomcat to perform classpath scanning, but only in project jar file, see TomcatWebServer.enableClasspathScanning().
Oddly enough Vaadin Lookup is initialized correctly, but that's because LookupServletContainerInitializer is ServletContainerInitializer mentioned in META-INF/services, which causes Tomcat to load it.
We could use the same technique to load and run ServletDeployer, something like:
but that's tricky: ServletDeployer fails if Lookup wasn't initialized, and therefore this would depend on the ordering of ServletContainerInitializers, which is fragile.
The text was updated successfully, but these errors were encountered:
((StandardContext) ctx).setDefaultWebXml(TomcatWebServer.class.getClassLoader().getResource("boot/web.xml").toExternalForm()); does nothing - the file is ignored and not loaded.
Vaadin's
ServletDeployer
is apparently not being called, and therefore the defaultVaadinServlet
isn't being configured automatically if the app doesn't provide one.The problem apparently is that Tomcat doesn't perform a full classpath scanning. Vaadin-Boot forces Tomcat to perform classpath scanning, but only in project jar file, see
TomcatWebServer.enableClasspathScanning()
.Perhaps setting
metadata-complete
to false can persuade Tomcat to perform full classpath scanning: https://stackoverflow.com/questions/9820379/what-to-do-with-annotations-after-setting-metadata-complete-true-which-resolvHowever, that's definitely not easy: it can't be programmatically configured for Tomcat Embedded: https://stackoverflow.com/questions/15988578/specify-a-custom-web-xml-to-an-embedded-tomcat
Oddly enough Vaadin Lookup is initialized correctly, but that's because
LookupServletContainerInitializer
isServletContainerInitializer
mentioned in META-INF/services, which causes Tomcat to load it.We could use the same technique to load and run
ServletDeployer
, something like:but that's tricky:
ServletDeployer
fails ifLookup
wasn't initialized, and therefore this would depend on the ordering ofServletContainerInitializer
s, which is fragile.The text was updated successfully, but these errors were encountered: