1. glassfish
  2. GLASSFISH-7066

EJB3 bean silently not published if it inherits the Remote interface from a POJO


    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 9.1peur2
    • Fix Version/s: not determined
    • Component/s: verifier
    • Labels:
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:


      Consider the following scenario:

      public interface TheRealRemote {

      String sayHello(String name);


      public class SomeOrdinaryClassImplementingTheRealRemote implements TheRealRemote {

      public String sayHello(String name)

      { return "Hello, " + name + "!"; }


      public class TheRealBean extends SomeOrdinaryClassImplementingTheRealRemote {


      Using plain Glassfish v2 UR2 b04, the Verifier returns 0 failures, 0 warnings
      and 0 errors for the EJB-JAR/EAR containing these classes. Deployment of the EAR
      also seems to complete fine without any error messages.

      However, the SLSB will not be properly deployed and its Remote interface not be
      published into JNDI. Any attempts to call this bean will therefore fail.

      But when we change TheRealBean to explicitly, but redundantly state that it
      implements TheRealRemote:

      public class TheRealBean extends SomeOrdinaryClassImplementingTheRealRemote
      implements TheRealRemote {


      the SLSB deploys fine, its remote interface will be bound to JNDI and the bean
      can successfully be called.

      The error seems to be that some statical analysis on TheRealBean class fails to
      detect that this class implements TheRealRemote indirectly, because it extends
      another POJO class that implements it.

      This issue has been found in a real-world customer application and was very hard
      to debug due to the complete lack of any error messages other than the inability
      to look up any Remote interfaces.

      The attached NetBeans project contains the full source for a test case EAR.
      Running the verifier on the EAR returns no errors, but TheRealRemote will not be
      bound into JNDI after deployment. Then add the redundant "implements
      TheRealRemote", and everything is fine.

      Many thanks in advance for fixing this!


        al130959 created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 7066 38670
        Tom Mueller made changes -
        Fix Version/s not determined [ 11149 ]
        Fix Version/s V3 [ 10981 ]


          • Assignee:
            Sanjeeb Sahoo
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: