Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2368

env-entry is not injected with @Resource annotation into CDI beans and JAX-RS resources

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 8.0.0.Beta1
    • CDI / Weld, REST
    • None
    • Medium

      I built simple web application to narrow down problem, consisting of war packaged in ear. It attempts to inject env-entry declared in web.xml using @Resource annotation into servlet, jax-rs resource and cdi managed bean.

      For now only servlet is injected with env-entry properly. JAX-RS resource requires @ManagedBean annotation in order to work, but still does not work if it is listed explicitly in its Application, rather than autoscanned. CDI bean does not work yet. Same app without modifications work properly in Jboss AS 7.1

      Below is example of CDI bean :

      @Named
      public class EnvEntryProducer {

      @Resource(name="demo") String env;

      @PostConstruct void logMe()

      { System.out.print("Env: " + env); }

      @Produces @Named("enventry") String getEnv()

      { return env; }

      }

      PostConstruct is not called yet as well

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              pragmasoft_jira Dmytro Zemnytskiy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: