• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 799
  • Last Modified:

when we look up using ctx.lookUp("java:env/comp/CustomerBean")

hi

In our application we look up beans using

1.
    home = (EJBHome)PortableRemoteObject.narrow(ctx.lookup(jndiName), homeClass)

2.
i have seen some where that we can look up beans using ctx.lookUp("java:env/comp/CustomerBean");

i know that when we go for PortableRemoteObject.but i dont know when we go for later one;



0
chaitu chaitu
Asked:
chaitu chaitu
1 Solution
 
zzynxSoftware engineerCommented:
And the question is?
0
 
petmagdyCommented:
u use:
ctx.lookUp("java:env/comp/CustomerBean");

when u have ub ur web.xml or ejb-jar.xml Resource reference like this:

    <ejb-local-ref >
        <ejb-ref-name>CustomerBean</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local-home>fullpackage.CustomerLocalHome</local-home>
        <local>fullpackage.CustomerLocal</local>
        <ejb-link>EjbJarName.jar#CustomerBean</ejb-link>
    </ejb-local-ref>
if local interface is used
or:
  <ejb-ref >
        <ejb-ref-name>CustomerBean</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <home>fullpackage.CustomerHome</home>
        <remote>fullpackage.Customer</remote>
        <ejb-link>EjbJarName.jar#CustomerBean</ejb-link>
    </ejb-ref>
if u r using Remote interface
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now