Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1548

"PreDestroy annotation can only be applied to the ejbRemove method" rule should only apply to the very class that implement SessionBean interface.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.7.0
    • 4.0
    • ejb31
    • None

    Description

      ejb3.1 spec 4.3.5

      If the session bean implements the SessionBean interface, the PreDestroy annotation can only be
      applied to the ejbRemove method; the PostActivate annotation can only be applied to the
      ejbActivate method; the PrePassivate annotation can only be applied to the ejbPassivate
      method. Similar requirements apply to use of deployment descriptor metadata as an alternative to the
      use of annotations.

      But for following cases, there are two PreDestroy methods. Both of them should be valid.

      class A {

      @PreDestroy
      public void xxxxx()

      { } }

      class B extends A implements SessionBean {

      @PreDestroy
      public void ejbRemove(){

      }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            genspring Lin Quan Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: