Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-1902

JBAS 5 allows create methods for EJB2x home interface client view with the name 'create' only

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Minor
    • None
    • 1.0.0-GA
    • core
    • None

    Description

      According to EJB3 spec, home/local home interfaces for ejb3 stateful session bean (adopted to ejb2x client view) can have multiple create<METHOD> methods. The requirement is that their names begin with "create". Each of this methods must have corresponding @Init method or ejbCreate<METHOD> methods in the bean class.

      When I was trying to run a bean with many create methods in its local home interface under JBOSS 5.0.1, I got an exception:
      "IllegalArgumentException - illegal home method ..." (followed by the signature of the method) thrown from the org.jboss.ejb3.session.SessionSpecContainer class.

      The create method's signature in local home interface is:

      public TestSF2xLocal createA() throws CreateException;

      where TestSF2xLocal is the bean's local component interface for 2.x client view. The bean class has a @Init method defined in it:
      @Init("createA") public void doInitA() ...

      I looked into the source code for ejb3 module a bit and found out, that the invokeHomeMethod method of the SessionSpecContainer class compares the name of the method being called to "create":

      if (method.getName().equals(Ejb2xMethodNames.METHOD_NAME_HOME_CREATE))

      { return this.invokeHomeCreate(method, args); }

      As this comparison fails in my case, an exception is thrown:

      else

      { throw new IllegalArgumentException("illegal home method " + method); }

      The very same bean works fine with Glassfish 2. I'd suggest that JBoss behaviour is against the spec in this case.

      Attachments

        Activity

          People

            rhn-engineering-cdewolf Carlo de Wolf
            demboos_jira Szymon Dembek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: