OpenEJB
  1. OpenEJB
  2. OPENEJB-1554

PostConstruct callback should be allowed in stateful session bean.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: (trunk/tomee)
    • Fix Version/s: 4.0
    • Component/s: ejb31
    • Labels:
      None

      Description

      In current trunk call back check code:

      org.apache.openejb.config.rules.CheckCallbacks.checkCallback(Class<?>, String, CallbackMethod, EnterpriseBean, Class...)
      {
      ....
      if (sb.getSessionType().equals(SessionType.STATELESS)) {
      if (!callback.getMethodName().equals("ejbCreate"))

      { fail(bean.getEjbName(), "callback.sessionbean.invalidusage", type, callback.getMethodName(), ejbClass); }

      } else

      { fail(bean.getEjbName(), "callback.sessionbean.invalidusage", type, callback.getMethodName(), ejbClass); }

      ...
      }

      so that when a post construct callback is used in statefull session bean. openejb will throw validate failure exception.

        Activity

        Hide
        Shawn Jiang added a comment -

        post construct should be allowed in stateful session bean per.

        ejb31 spec 4.3.10

        Show
        Shawn Jiang added a comment - post construct should be allowed in stateful session bean per. ejb31 spec 4.3.10

          People

          • Assignee:
            Shawn Jiang
            Reporter:
            Shawn Jiang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development