1 Reply Latest reply on Sep 5, 2014 9:10 AM by sumncc

    CDI issue with abstract class.

    sumncc

      Hi All, I may be in the wrong side of the stick, But I need to do this, Can anybody help me please.

       

      I have these classes...

       

      interface A{

           void add();

            void sub();

      }

       

      class abtract B implements A{

           void add (){

               // do some stuff

           }

      }

       

      @stateless

      class C extends B{

           void sub(){

              // do something

            }

      }

       

       

      @stateless

      class D extends B{

           void sub(){

              // do something

            }

      }

       

       

      Then I want to use C and D with different facades. Like these...

      class X1 {

         @Inject private C  objC;

           void dosomehting(){

              // do something

            }

      }

      class X2 {

         @Inject private D  objD;

           void dosomehting(){

              // do something

            }

      }

       

       

      I tried to use Qualifiers(named and  annotations both) and alternatives  but I am not getting it right with none-satisfied dependencies or ambiguous dependency.

       

      Can I have here your valuable advice , please.

       

       

      Many Thanks

        • 1. Re: CDI issue with abstract class.
          sumncc

          Hi Guys, I have solved it by using this in beans.xml

          <weld:scan>

               <weld:exclude name="com.something.B"/>

             </weld:scan>


          As result no ambiguity  and work fine for me.


          Thanks to all.

          R

          1 of 1 people found this helpful