glassfish
  1. glassfish
  2. GLASSFISH-18998

manual JNDI lookup for "corbaname:iiop:..." doesn't work while ejb-ref with jndi-name in the same syntax works

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: naming
    • Labels:
      None
    • Environment:

      Description

      An EAR application deployed on the 1. server shows in the jndi brower com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote.

      In an EAR Application deployed on the second server an ejb-ref is created via deployment descriptor:
      ejb-jar.xml:
      <ejb-ref>
      <ejb-ref-name>ejb/UCP_EJB_SERVICE_DEV</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <remote>com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote</remote>
      </ejb-ref>
      glassfish-ejb-jar
      <ejb-ref>
      <ejb-ref-name>ejb/UCP_EJB_SERVICE_DEV</ejb-ref-name>
      <jndi-name>corbaname:iiop:ltusp01.bmwgroup.net:3792#com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote</jndi-name>
      </ejb-ref>

      and it works.
      Trying to connect from the same client EAR via:

      ic = new InitialContext();
      service = (UCPBusinessServicesSFRemote) ic.lookup(
      "corbaname:iiop:ltusp01.bmwgroup.net:3792#com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote");

      fails with NameNotFoundException.
      But the EJB 3.0 spec (ejb-3_0-fr-spec-ejbcore.pdf)states in chapter 3.4.3:

      "From the point of view of the client, a session object exists once the client has obtained a reference to its
      business interface—whether through dependency injection or from lookup of the business interface in
      JNDI."

        Activity

        Hide
        lzg5039 added a comment -

        ejb-jar.xml:

        <enterprise-beans>
            <session>
                <ejb-name>Hello</ejb-name>
                <ejb-class>org.glassfish.ejb.hello.HelloBean</ejb-class> 
            <ejb-ref>
                <ejb-ref-name>ejb/UCP_EJB_SERVICE_DEV</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <remote>com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote</remote>
        </ejb-ref>
        </session>
        </enterprise-beans>
        

        glassfish-ejb-jar

        <enterprise-beans>
            <ejb>
                <ejb-name>Hello</ejb-name>
                <jndi-name>HelloJndiName</jndi-name>
                <ejb-ref>
                    <ejb-ref-name>ejb/UCP_EJB_SERVICE_DEV</ejb-ref-name>
                    <jndi-name>corbaname:iiop:1.2@ltusp01.bmwgroup.net:3792#com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote</jndi-name>
                </ejb-ref>
            </ejb>
        </enterprise-beans>
        

        you can lookup jndi-name like following code
        ic = new InitialContext(props);
        hello = (Hello) ic.lookup("HelloJndiName");

        and in the ejb of Hello could excute the following code
        ic = new InitialContext() ;
        ucpBusinessServicesSFRemote= ( UCPBusinessServicesSFRemote)ic.lookup( "java:comp/env/ejb/UCP_EJB_SERVICE_DEV" ) ;

        Show
        lzg5039 added a comment - ejb-jar.xml: <enterprise-beans> <session> <ejb-name> Hello </ejb-name> <ejb-class> org.glassfish.ejb.hello.HelloBean </ejb-class> <ejb-ref> <ejb-ref-name> ejb/UCP_EJB_SERVICE_DEV </ejb-ref-name> <ejb-ref-type> Session </ejb-ref-type> <remote> com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote </remote> </ejb-ref> </session> </enterprise-beans> glassfish-ejb-jar <enterprise-beans> <ejb> <ejb-name> Hello </ejb-name> <jndi-name> HelloJndiName </jndi-name> <ejb-ref> <ejb-ref-name> ejb/UCP_EJB_SERVICE_DEV </ejb-ref-name> <jndi-name> corbaname:iiop:1.2@ltusp01.bmwgroup.net:3792#com.bmw.ucp.bus.facade.UCPBusinessServicesSFRemote </jndi-name> </ejb-ref> </ejb> </enterprise-beans> you can lookup jndi-name like following code ic = new InitialContext(props); hello = (Hello) ic.lookup("HelloJndiName"); and in the ejb of Hello could excute the following code ic = new InitialContext() ; ucpBusinessServicesSFRemote= ( UCPBusinessServicesSFRemote)ic.lookup( "java:comp/env/ejb/UCP_EJB_SERVICE_DEV" ) ;
        Hide
        Tom Mueller added a comment -

        Reassigning to component lead as the assignee is no longer with the project.

        Show
        Tom Mueller added a comment - Reassigning to component lead as the assignee is no longer with the project.
        Hide
        guojun.shan added a comment -

        not a bug, please close it.

        Show
        guojun.shan added a comment - not a bug, please close it.
        Hide
        guojun.shan added a comment -

        this is not a bug, could you please close it? thanks.

        Show
        guojun.shan added a comment - this is not a bug, could you please close it? thanks.
        Hide
        Tom Mueller added a comment -

        Closing as requested.

        Show
        Tom Mueller added a comment - Closing as requested.

          People

          • Assignee:
            Tom Mueller
            Reporter:
            petraleomue
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: