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

Return a business interface from a home create method must not be allowed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • AS 5.0.0.CR1
    • AS 4.2.2.GA
    • None
    • None

      EJB 3 Core Specification Section 4.6.8: The return type for a create<METHOD> method must be the session bean's remote interface type.

      EJB 3 Core Specification Section 4.6.10: The return type for a create<METHOD> method must be the session bean's local interface type.

      Using the proxy as if it would be an EJBObject/EJBLocalObject results in class cast exceptions.

      java.lang.ClassCastException: $Proxy9
      at org.jboss.ejb3.test.stateful.unit.RemoteUnitTestCase.testEJBObject(RemoteUnitTestCase.java:208)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:23)

            arubinge@redhat.com Andrew Rubinger (Inactive)
            rhn-engineering-cdewolf Carlo de Wolf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: