[GLASSFISH-18998] manual JNDI lookup for "corbaname:iiop:..." doesn't work while ejb-ref with jndi-name in the same syntax works Created: 13/Aug/12  Updated: 25/Mar/13  Resolved: 25/Mar/13

Status: Resolved
Project: glassfish
Component/s: naming
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: petraleomue Assignee: Tom Mueller
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Server 1 Sun GlassFish Enterprise Server v2.1 (9.1.1) (build b60e-fcs) running on Linux 2.6.32.54-0.3-xen #1 SMP 2012-01-27 17:38:56 +0100 x86_64 x86_64 x86_64 GNU/Linux
Server 2 GlassFish Server Open Source Edition 3.1.1 (build 12) running on Windows 7


Tags: EJB, lookup, remote

 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."



 Comments   
Comment by lzg5039 [ 12/Dec/12 ]

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" ) ;

Comment by Tom Mueller [ 15/Feb/13 ]

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

Comment by guojun.shan [ 25/Mar/13 ]

not a bug, please close it.

Comment by guojun.shan [ 25/Mar/13 ]

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

Comment by Tom Mueller [ 25/Mar/13 ]

Closing as requested.

Generated at Tue May 26 08:32:56 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.