0 Replies Latest reply on Oct 24, 2010 2:46 PM by B Bozhanov

    Suggestion about "not a stereotype" exception

    B Bozhanov Newbie

      I just created a @Stereotype and the container claimed that:


      weld-001317 interface ... is not a stereotype


      Luckily I have the spec opened, so I identified the problem fairly quickly:




      A bean stereotype is a Java annotation defined as @Target({TYPE, METHOD, FIELD}), @Target(TYPE), @Target(METHOD), @Target(FIELD) or @Target({METHOD, FIELD}) and @Retention(RUNTIME).


      I had omitted the @Target, and when I set it, the problem was fixed.


      So, my suggestion is - in case an annotation annotated with @Stereotype does not define @Target, Weld should be more informative and state the exact problem, rather than leaving the person wondering.