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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 3.0.14.Final
    • 3.0.13.Final
    • None
    • None
    • 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();

      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()

            psotirop@redhat.com Panagiotis Sotiropoulos
            nicones Nicolas NESMON (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: