1 Reply Latest reply on Aug 12, 2008 5:28 AM by alrubinger

    Patch to MappedReferenceMetadataResolverDeployer fixes EJB3,

    alrubinger

      Issue is:

      http://jira.jboss.org/jira/browse/EJBTHREE-1455

      EJB References and EJB Local References need to map to the interface-specific proxy to be equipped with proper information for SessionContext.getInvokedBusinessInterface.

      However, EJB2 has no "interface-specific" Proxies.

      So how can I determine which spec version is being used so I can take the appropriate action?

      Patch is:

      Index: server/src/main/org/jboss/deployment/MappedReferenceMetaDataResolverDeployer.java
      ===================================================================
      --- server/src/main/org/jboss/deployment/MappedReferenceMetaDataResolverDeployer.java (revision 76968)
      +++ server/src/main/org/jboss/deployment/MappedReferenceMetaDataResolverDeployer.java (working copy)
      @@ -883,7 +884,8 @@
       {
       cdmd.addDependency(target);
       // Need to look at the local jndi name
      - String localJndiName = target.getBeanMetaData().determineLocalJndiName();
      + String localInterface = ref.getLocal();
      + String localJndiName = target.getBeanMetaData().determineResolvedJndiName(localInterface);
       if(localJndiName != null)
       ref.setResolvedJndiName(localJndiName);
       }
      @@ -969,7 +971,8 @@
       // Determine the jndi name for the reference interface
       String iface = getInterface(ref);
       //LegacyEjb3JndiPolicy policy = new LegacyEjb3JndiPolicy();
      - String containerJndiName = target.getBeanMetaData().determineJndiName();
      + String businessInterface = ref.getRemote();
      + String containerJndiName = target.getBeanMetaData().determineResolvedJndiName(businessInterface);
       if(containerJndiName != null)
       ref.setResolvedJndiName(containerJndiName);
       }


      This breaks smoke-tests for EJB2.x, but passes my EJB3 defining test case.

      S,
      ALR

        • 1. Re: Patch to MappedReferenceMetadataResolverDeployer fixes E
          alrubinger

           

          "ALRubinger" wrote:
          So how can I determine which spec version is being used so I can take the appropriate action?


          Possibly the dumbest question ever put forth on this forum.

          getEjbJarMetaData().isEJB3x() is what I'll use to fix this, but I'll continue to note that I would have expected this to be handled by jboss-metadata and proper decorators on EJB2.x beans to use the right JNDI resolution logic.

          S,
          ALR