2 Replies Latest reply on Jan 16, 2013 2:27 PM by lhelander

    JAX-RS bean discovery

    lhelander

      I have an application that contains JAX-RS beans as well as CDI beans. When I study the log from running the application on JBOSS AS 7 (7.1.1 final), it seems like that the CDI container discovers the JAX-RS beans and "hands" them over to JAX-RS, is this a correct observation? If so, is this according to some specification, and if so which one, or is this a JBoss implementation dependent behaviour?

      In this case is the JAX-RS own discovery disabled or will JAX-RS know about the bean from two sources?

       

      It would be highly appreciated if someone could clarify this or point to some specification or other documentation where I could find the relevant information.

       

      Thanks

       

      Lars

        • 1. Re: JAX-RS bean discovery
          jharting

          Hi Lars,

           

          this is defined in the JAX-RS 1.1 specification. The section 6.2 says:

           

          In a product that also supports Managed Beans, implementations MUST support use of Managed Beans as root resource classes, providers and Application subclasses. In a product that also supports JSR 299, implementations MUST similarly support use of JSR299-style managed beans. Providers and Application subclasses MUST be singletons or use application scope.

          1 of 1 people found this helpful
          • 2. Re: JAX-RS bean discovery
            lhelander

            Jozef,

             

            thank you very much for the quick feedback and for providing the specification refrerences.

             

            Thanks

             

            Lars