Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-6723

CDI injection into JAX-RS service does not work when hot-deployed.

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 7.1.1.Final
    • Fix Version/s: None
    • Component/s: CDI / Weld, REST
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      To reproduce the issue use following steps:
      1.) Get the reproducer from git://github.com/pmacik/jaxrs-cdi-reproducer.git
      2.) Get out-of-the-box JBoss AS7 (7.1.1.Final)
      3.) Start the AS up
      4.) Build the reproducer WAR using "mvn package"
      5.) Deploy the reproducer WAR - copy the WAR into (JBOSS_HOME)/standalone/deployments directory
      6.) Go to http://localhost:8080/JAXRS-CDI-reproducer/rest/bean/getAll -> NPE is thrown (bean was not injected)
      7.) Go to http://localhost:8080/JAXRS-CDI-reproducer/BeanServlet -> the bean is properly injected

      Show
      To reproduce the issue use following steps: 1.) Get the reproducer from git://github.com/pmacik/jaxrs-cdi-reproducer.git 2.) Get out-of-the-box JBoss AS7 (7.1.1.Final) 3.) Start the AS up 4.) Build the reproducer WAR using "mvn package" 5.) Deploy the reproducer WAR - copy the WAR into (JBOSS_HOME)/standalone/deployments directory 6.) Go to http://localhost:8080/JAXRS-CDI-reproducer/rest/bean/getAll -> NPE is thrown (bean was not injected) 7.) Go to http://localhost:8080/JAXRS-CDI-reproducer/BeanServlet -> the bean is properly injected
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Deploy WAR before AS is started:

      Workaround (deploy before AS is started):
      1.) Get the reproducer from git://github.com/pmacik/jaxrs-cdi-reproducer.git
      2.) Get out-of-the-box JBoss AS7 (7.1.1.Final)
      3.) Build the reproducer WAR using "mvn package"
      4.) Deploy the reproducer WAR - copy the WAR into (JBOSS_HOME)/standalone/deployments directory
      5.) Start the AS up
      6.) Go to http://localhost:8080/JAXRS-CDI-reproducer/rest/bean/getAll -> empty collection XML is returned (bean was injected properly))
      7.) Go to http://localhost:8080/JAXRS-CDI-reproducer/BeanServlet -> the bean is properly injected

      Show
      Deploy WAR before AS is started: Workaround (deploy before AS is started): 1.) Get the reproducer from git://github.com/pmacik/jaxrs-cdi-reproducer.git 2.) Get out-of-the-box JBoss AS7 (7.1.1.Final) 3.) Build the reproducer WAR using "mvn package" 4.) Deploy the reproducer WAR - copy the WAR into (JBOSS_HOME)/standalone/deployments directory 5.) Start the AS up 6.) Go to http://localhost:8080/JAXRS-CDI-reproducer/rest/bean/getAll -> empty collection XML is returned (bean was injected properly)) 7.) Go to http://localhost:8080/JAXRS-CDI-reproducer/BeanServlet -> the bean is properly injected

      Gliffy Diagrams

        Attachments

          Activity

            People

            • Assignee:
              swd847 Stuart Douglas
              Reporter:
              pmacik Pavel Macik
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: