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

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.7.0
    • Fix Version/s: 4.0
    • Component/s: ejb31
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: