glassfish
  1. glassfish
  2. GLASSFISH-20511

IllegalStateException: EJBObject not available on stateful session bean's SessionContext.getEJBObject().getHandle();

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Works as designed
    • Affects Version/s: 3.1.2.2
    • Fix Version/s: None
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Windows 32bit, java 6

      Description

      When calling SessionContext.getEJBObject().getHandle(); inside a method in a stateful session bean, the server throws java.lang.IllegalStateException: EJBObject not available

      I think that the server should allow to access handle to a stateful session bean even if it's EJB 3-like implementation. Spec is not clear about this so I'd assume the backward compatibility. I am attaching example application.

      In my opinion it's against the javadoc

      EJBObject getEJBObject()
      throws java.lang.IllegalStateException

      Obtain a reference to the EJB object that is currently associated with the instance.

      An instance of a session enterprise Bean can call this method at anytime between the PostConstruct or ejbCreate and the PreDestroy or ejbRemove methods, including from within these methods.

      An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            marina vatkina
            Reporter:
            Marcin_C
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: