Hi Achim,
The servlet is not working if the jfaces Excepton is thrown during startup of the servlet context.
However, I think I got this running now. There were actually multiple issues that were preventing the tests from running (at least the one I checked for now, I hope the others are easier):
1. el-Support was not running in tomcat. The el-lookup only works if the pax-web-jsp bundle (where the el-Implementation is located) is in the classpath. I copied some code from the jetty implementation that sets a parent classloader to the conecxt and imported the javax.el bundles in the pax-web-tomcat bundles as optional dependencies for that (the same imports as in pax-web-jetty).
2. The jfaces library creates an internal map for the factories. The key for the map is the thread context classloader, so the lookup will fail if the initialization of the factories is done with a different thread context classloader than the initi call, you see the second exception I posted intially. It also means that the operation that is attempted fails (which may be less critical for other operations than the init call). Removing two thread context class loader changes from the code made the servlet finally work. Unfortunately I don't know why these class loader changes were there in the first place, so I might have broken something else in the process (need to have a look about this).
3. The tests themselves also had issues: Tomcat does not support welcome files (so the index.jsp has to be called directly). Furthermore the test comcat server is running with a different port than the itest-jetty server, but the second server call in one of the tests was to the jetty port (so this can never have worked).
If I get this running smoothly, do I cfeate the pull request for PAXWEB-993 (as it also enables the JSF tests, or do I create a new JIRA task (because it actually also fixes JSF support with tomcat).
Best regards
Stephan
Am Freitag, 10. März 2017 16:58:58 UTC+1 schrieb Achim Nierbeck: