Closed enver-haase closed 3 years ago
Hi, only Pax Web 8 (still work in progress) handles this annotation correctly... I can't tell when it will be released.
Thanks a lot!
I reckon it is that the
If an implementation of ServletContainerInitializer specifies this annotation, the Servlet container must pass the Set of application classes that extend, implement, or have been annotated with the class types listed by this annotation to the ServletContainerInitializer.onStartup(java.util.Set>, javax.servlet.ServletContext) method of the ServletContainerInitializer (if no matching classes are found, null must be passed instead)
is incorrectly handled so far, instead the set of class types classes listed by the annotation is passed.
Correct - and that's what Pax Web 8 solved by introducing better scanning.
I've even found related Tomcat problem: https://bz.apache.org/bugzilla/show_bug.cgi?id=65244
Regarding the link to the related Tomcat problem: I don't think it hurts passing interfaces (can have code after all) when they are found, I would simply go with copying the semantics of Jetty9/Tomcat8 code which actually does work to bring up Vaadin10/14/20 applications. But my opinion does not matter that much, maybe ask Rajiv Mordani.
Is there any way I could plug some preview Pax Web 8 or just that fixed @HandlesTypes scan into my Karaf 4.3.2 ? I am actually blocked until I find a work-around.
Unfortunately Pax Web 8 is still work-in-progress. I'm now working on ordering listeners coming from multiple sources and it's not possible you take the part that's related to @HandlesTypes
;(
This is only part of pax-web-extender-war (implementation of chapter 128 of OSGi CMPN specification) and doesn't have anything in common with Whiteboard/HttpService...
And yes - in order to scan available jars (and reachable bundles) I reuse tomcat's BCEL-based scanning
BCEL... unbelievable it's still in use. I was in Markus' office when he was thinking about donating it to Apache back in 2001!
:) it's just packaged within Tomcat. When Jasper is being reused, why not BCEL?
True that. I just thought it may have become 'old', replaced by asm
or such. I certainly didn't touch my part in BCEL for 20 or so years (the verifier), yet there has been lots of development in that area (preverification, new class file versions).
Never mind -- in case you have a good idea of how I could get a Vaadin 20 application to fly in Pax-Web, please let me know.
I am currently taking notes of what classes are found in Tomcat in a standard Vaadin 20 Hello World App, in order to hard-code a ServletContainerInitializer from which I will be calling the real SCIs with correct sets of classes.
@enver-haase if you point me to a maven project/module of Vaadin with war
packaging, I could work on Pax Web integration tests for it :)
Now I'm working on AriesCDI + MyFaces 2.3.x test + WAB case and it's almost done (but definitely the hardest one I had to deal with)
https://github.com/enver-haase/Playground/tree/master/vaadin20-base
This one perhaps? compile with mvn clean -Pproduction package
and find the *.war in target/
.
Note that the web.xml is only here to convince Pax Web to actually kick off, not needed for Jetty9 or Tomcat8.
Thanks! I can't promise though I'll do it today. But I'm definitely not closing this tab in Firefox, so I remember ;)
As mentioned in https://stackoverflow.com/questions/67867281/how-to-run-a-vaadin-8-or-20-application-on-karaf-4-3-2-with-pax-web, Pax Web 8 handles the annotation correctly. There are other things to solve, but this Vaadin example is great to be included in Pax Web 8 test suite. For now, I'm closing this issue as fixed in Pax Web 8.0.0...
Test case: https://github.com/vaadin/flow/issues/11178
Basically, Vaadin 10+ relies on the container handling "@HandlesTypes" correctly, and while it is documented in Pax-Web 5.x that this will not work, I could not find a mention of this any more in the 7.x series.