Thanks a lot for this info , Rupesh. I did realise later after sending the mail that I had missed making the entries in the web deployment descriptors( I was doing the lookups from the web tier). It has solved my problem but I still need some clarifications regarding Local/Remote calls.
In my deployment scenario , all the objects reside on the same host.I really dont know why EJBs were required here but we used it. We could have done with normal java classes also ...but never mind...that's another issue. I haven't upgraded yet to EJB 2.0 ...am still on 1.1. I believe that the <ejb-local-ref> tag that you mention here has been introduced from EJB 2.0 onwards. So does this mean that if I wish to stick to the EJB 1.1 specification (that is with the <remote> tags )and make lookups the "java:comp/env...." way , then I am actually not achieving anything better ? Can you explain w.r.t EJB 1.1....what is the advantage of binding ejbs in the internal namespace "java:comp/env.." over binding them in the global namespace? (like the way I had done in my deployment descriptors). Would lookups be treated as a Local call or a Remote call if all objects reside in the same machine though the EJB 1.1 deployment descriptor says <remote>? Regards, - Rahul > -----Original Message----- > From: Rupesh [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 10:10 PM > To: Rahul Aras; [EMAIL PROTECTED] > Subject: Re: ENC lookup problems > > > If you need to do a lookup with > "java:comp/env/ejb/MyAdminHome", then you > need to define an ejb-ref for the desired bean. > > Where are you doing the lookup? If the lookup code is in > another bean say > MyBean then in ejb-jar.xml, for MyBean you will need to add > ejb-ref for > MyAdminHome. > > Descriptor for this will bean will look like > <session> > <ejb-name>MyBean</ejb-name> > <home>abc.cde.MybeanHome</home> > <remote>abc.cde.MyBeanRemote</remote> > <ejb-class>abc.cde.MyBean</ejb-class> > <session-type>Stateless</session-type> > <transaction-type>Container</transaction-type> > <ejb-ref> > <description>No Description</description> > <ejb-ref-name>ejb/MyAdminHome</ejb-ref-name> > <ejb-ref-type>Entity</ejb-ref-type> > <home>com.abc.xyz.ejb.MyAdminHome</local-home> > <remote>com.abc.xyz.ejb.MyAdmin</local> > </ejb-ref> > </session> > > If the home being looked up is local, then you will need to add > ejb-local-ref. > > Then in weblogic-ejb-jar.xml, under "reference-descriptor", > you will have to > specify which ref maps to which jndi name. > > If the lookup code is in any web component, (jsp/Servlet) > then you will need > to put the refs in web.xml similarly and another entry in > weblogic.xml. > > In java client, you can not lookup with "java:comp/env... " unless the > server has Application client container. Wl6.1 does not have > this. So, You > will need to do a direct JNDI lookup for this purpose. > > Regards, > Rupesh. > > > Hi All , > > > > I have a stateless session ejb which is NOT referencing any > other ejbs. I > > just wish to perform a JNDI lookup via ENC and this is how > I am doing it. > I > > have successfully deployed it on Weblogic 6.1 server. > > > > Context ctx = new InitialContext(); > > Object obj = ctx.lookup("java:comp/env/ejb/MyAdminHome");//throws an > > Exception > > > > BUT > > > > Object obj = ctx.lookup("MyAdminHome");//works fine > > .... > > .... > > > > > > But it gives me an Exception saying > > > > Unable to resolve comp/env/ejb/SMProCardSpendAdminHome Resolved: > 'comp/env' > > Unresolved:'ejb' > > > > The ejb-jar.xml looks like this > > <ejb-jar> > > <enterprise-beans> > > <session> > > <ejb-name>MyAdminBean</ejb-name> > > <home>com.abc.xyz.ejb.MyAdminHome</home> > > <remote>com.abc.xyz.ejb.MyAdmin</remote> > > <ejb-class>com.abc.xyz.ejb.MyAdminBean</ejb-class> > > <session-type>Stateless</session-type> > > <transaction-type>Container</transaction-type> > > </session> > > </enterprise-beans> > > </ejb-jar> > > > > and the weblogic-ejb-jar.xml looks like this > > > > <weblogic-enterprise-bean> > > <ejb-name>MyAdminBean</ejb-name> > > <stateless-session-descriptor> > > <pool> > > > <max-beans-in-free-pool>100</max-beans-in-free-pool> > > > > <initial-beans-in-free-pool>5</initial-beans-in-free-pool> > > </pool> > > </stateless-session-descriptor> > > <jndi-name>MyAdminHome</jndi-name> > > </weblogic-enterprise-bean> > > > > Where am I faltering? Can anybody please point out? I saw > the petstore > > weblogic deployment descriptor for the Customer session > bean but couldnt > > understand how the ENC lookup was working there. > > > > - Rahul > > > > > ============================================================== > ============= > > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the > body > > of the message "signoff EJB-INTEREST". For general help, > send email to > > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
