-
Bug
-
Resolution: Done
-
Major
-
1.4.0.Final
By commit e3e3b109b27e6f1e483802d1dc0d5ef36da32fe5 (UNDERTOW-781 Deprecate ThreadSetupAction) ordering in method DeploymentManagerImpl#deploy was changed.
Now ThreadSetupActions from deploymentInfo accepting into deployment before #handleExtensions call, so our ThreadSetupActions, which we pass into deploymentInfo in our ServletExtension, is ignored:
#deploy fragment
final DeploymentInfo deploymentInfo = originalDeployment.clone(); if (deploymentInfo.getServletStackTraces() == ServletStackTraces.ALL) { UndertowServletLogger.REQUEST_LOGGER.servletStackTracesAll(deploymentInfo.getDeploymentName()); } deploymentInfo.validate(); final DeploymentImpl deployment = new DeploymentImpl(this, deploymentInfo, servletContainer); this.deployment = deployment; final List<ThreadSetupHandler> setup = new ArrayList<>(); setup.add(ServletRequestContextThreadSetupAction.INSTANCE); setup.add(new ContextClassLoaderSetupAction(deploymentInfo.getClassLoader())); setup.addAll(deploymentInfo.getThreadSetupActions()); deployment.setThreadSetupActions(setup); // !!!! this actions will work good after deploy final ServletContextImpl servletContext = new ServletContextImpl(servletContainer, deployment); deployment.setServletContext(servletContext); handleExtensions(deploymentInfo, servletContext); //!!! our actions, which accepts in extensions, will be ignored
We still use old deprecated actions, but seems that problem also exists for new beauty handlers.
sdouglas1@redhat.com, please check call ordering in #deploy or explain the right way to add ThreadSetupHandler to deployment, if the way through ServletExtension is no longer supported.