2 Replies Latest reply on Jan 25, 2008 1:15 PM by Sanne Grinovero

    Seam Validator: @Remove & @Destroy errors

    Sanne Grinovero Master

      Hi, I'm using JBoss Developer Studio (licensed).
      I've found some little bugs I would like to discuss before submitting to JIRA,
      to get your approval.

      Seam Validator has this problems:

      - It gives me false errors about

      Stateful component "mybean" must have a method marked @Destroy"

      and
      Stateful component "mybean" must have a method marked @Remove"


      The validor is partially right, as these class doesn't have these methods, but they are inherited: I think the validator should look also on annotations of superclasses. I had to disable this validation, but it looks very usefull.

      A second problem I have with the same validator is
      Duplicate @Remove method "methodname"

      even on standard beans (non-entity). The configuration panel for the validator has a section to control this, but looks to be only for entities. This is not an entity, still I can disable it there as a workaround.

      Even for this one, it is very nice to have this validation and it's a pity I have to disable them. I didn't know I couldn't have multiple @Remove on an entity, is that true?

      Should I submit these two problems to JIRA?
      I would love to submit my own fix, but need some expert to coach and supervise me.

        • 1. Re: Seam Validator: @Remove & @Destroy errors
          Alexey Kazakov Master

           

          "sannegrinovero" wrote:
          The validor is partially right, as these class doesn't have these methods, but they are inherited: I think the validator should look also on annotations of superclasses.

          Yes, you are rigth. This is a bug. Please, submit it to JIRA.
          "sannegrinovero" wrote:

          A second problem I have with the same validator is
          Duplicate @Remove method "methodname"

          even on standard beans (non-entity). The configuration panel for the validator has a section to control this, but looks to be only for entities. This is not an entity, still I can disable it there as a workaround.

          And there is another bug :) The validator should check duplicate @Remove method only for stateful session bean component. Please, submit it to JIRA too.
          "sannegrinovero" wrote:
          I didn't know I couldn't have multiple @Remove on an entity, is that true?

          At least Seam does not allow to have multiple @Remove in stateful session bean components.
          If you try then Seam throws IllegalArgumentException("Stateful session bean component must have a method with no parameters marked @Remove: " + name);

          • 2. Re: Seam Validator: @Remove & @Destroy errors
            Sanne Grinovero Master

            I opened:

            http://jira.jboss.com/jira/browse/JBIDE-1691

            and

            http://jira.jboss.com/jira/browse/JBIDE-1690

            (this one is already resolved, you're very fast!!)

            should i close it ?

            thanks!