Issue Details (XML | Word | Printable)

Key: GLASSFISH-18998
Type: Bug Bug
Status: Resolved Resolved
Resolution: Invalid
Priority: Major Major
Assignee: Tom Mueller
Reporter: petraleomue
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

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

Created: 13/Aug/12 02:01 PM   Updated: 25/Mar/13 02:18 PM   Resolved: 25/Mar/13 02:18 PM
Component/s: naming
Affects Version/s: None
Fix Version/s: None

Time Tracking:
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
Participants: guojun.shan, lzg5039, petraleomue and Tom Mueller


 Description  « Hide

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



lzg5039 added a comment - 12/Dec/12 01:37 AM

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


Tom Mueller added a comment - 15/Feb/13 10:45 PM

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


guojun.shan added a comment - 25/Mar/13 07:59 AM

not a bug, please close it.


guojun.shan added a comment - 25/Mar/13 08:01 AM

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


Tom Mueller added a comment - 25/Mar/13 02:18 PM

Closing as requested.