Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1593

ResteasyBootstrap no longer registers the deployment dispatcher in the servlet context attributes

XMLWordPrintable

      The code in ResteasyBootstrap used to register (among other things) the dispatcher and the registry:

      ResteasyBootstrap#contextInitialized
            servletContext.setAttribute(ResteasyProviderFactory.class.getName(), deployment.getProviderFactory());
            servletContext.setAttribute(Dispatcher.class.getName(), deployment.getDispatcher());
            servletContext.setAttribute(Registry.class.getName(), deployment.getRegistry());
      

      these instances are then expected to be found and then re-used by the servlet dispatcher:

      ServletContainerDispatcher#init
       ResteasyProviderFactory globalFactory = (ResteasyProviderFactory) servletContext.getAttribute(ResteasyProviderFactory.class.getName());
            Dispatcher globalDispatcher = (Dispatcher) servletContext.getAttribute(Dispatcher.class.getName());
      

      This used to be the case in versions before 3.1.0.Final - as of then, the ResteasyBootstrap only registers the deployment, but the code in the ServletContainerDispatcher has not changed. This means, that now instead of using the same registry where all the Spring beans are registered, a new (and empty) registry is used, thus making the Spring beans inaccessible

            rhn-support-asoldano Alessio Soldano
            lyorg Lyor Goldstein (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: