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

Properties from javax.ws.rs.core.Application.getProperties are not registered

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 3.0.13.Final
    • Fix Version/s: 3.0.14.Final
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      HttpServer server = HttpServer.create(new InetSocketAddress(9998), 1);
      HttpContextBuilder contextBuilder = new HttpContextBuilder();
      Application application = new Application() {
      @Override
      public Map<String, Object> getProperties()

      { return Collections.<String, Object> singletonMap("Prop1", "Value1"); }

      @Override
      public Set<Class<?>> getClasses()

      { Set<Class<?>> classes = new HashSet<>(); classes.add(UsersResource.class); classes.add(ServerSecurityFeature.class); return classes; }

      @Override
      public Set<Object> getSingletons() {
      return Collections.<Object> singleton(new Feature() {
      @Override
      public boolean configure(FeatureContext featureContext)

      { // Always return false event if the property is // correctly registered return featureContext.getConfiguration() .getProperties().containsKey("Prop1"); }

      });
      }

      };
      contextBuilder.getDeployment().setApplication(application);
      HttpContext context = contextBuilder.bind(server);
      server.start();

      Show
      HttpServer server = HttpServer.create(new InetSocketAddress(9998), 1); HttpContextBuilder contextBuilder = new HttpContextBuilder(); Application application = new Application() { @Override public Map<String, Object> getProperties() { return Collections.<String, Object> singletonMap("Prop1", "Value1"); } @Override public Set<Class<?>> getClasses() { Set<Class<?>> classes = new HashSet<>(); classes.add(UsersResource.class); classes.add(ServerSecurityFeature.class); return classes; } @Override public Set<Object> getSingletons() { return Collections.<Object> singleton(new Feature() { @Override public boolean configure(FeatureContext featureContext) { // Always return false event if the property is // correctly registered return featureContext.getConfiguration() .getProperties().containsKey("Prop1"); } }); } }; contextBuilder.getDeployment().setApplication(application); HttpContext context = contextBuilder.bind(server); server.start();

      Description

      Properties from javax.ws.rs.core.Application.getProperties are not registered by ResteasyProviderFactory.
      ResteasyDeployment.processApplication() seems to only care about Application.getClasses() and Application.getSingletons() not Application.getProperties()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Takis Panagiotis Sotiropoulos
              Reporter:
              nicolas.n Nicolas NESMON
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: