Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5199

Race condition in HttpServiceFactory.getService() causing exception

    XMLWordPrintableJSON

Details

    Description

      The HttpServiceFactory.getService() is as follows:

          public HttpService getService(final Bundle bundle, final ServiceRegistration<HttpService> reg)
          {
              final ServletContext servletContext = this.context;
              if ( servletContext != null ) {
                  return new PerBundleHttpServiceImpl(bundle,
                          this.sharedHttpService,
                          this.context,
                          this.contextAttributeListenerManager,
                          this.sharedContextAttributes,
                          this.requestListenerManager,
                          this.requestAttributeListenerManager);
              }
              return null;
          }

      However it is possible that this.context is set to null after the check for null is done but before the constructor is called causing a null servlet context to be passed to PerBundleHttpServiceImpl

      Attachments

        1. felix-5199.patch
          0.8 kB
          David Bosschaert

        Activity

          People

            bosschaert David Bosschaert
            bosschaert David Bosschaert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: