Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 82223 invoked from network); 19 Apr 2006 10:27:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Apr 2006 10:27:41 -0000 Received: (qmail 98078 invoked by uid 500); 19 Apr 2006 10:27:34 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 97959 invoked by uid 500); 19 Apr 2006 10:27:33 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 97579 invoked by uid 99); 19 Apr 2006 10:27:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Apr 2006 03:27:31 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ammulder@gmail.com designates 64.233.166.177 as permitted sender) Received: from [64.233.166.177] (HELO pproxy.gmail.com) (64.233.166.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Apr 2006 03:27:30 -0700 Received: by pproxy.gmail.com with SMTP id t32so1136423pyc for ; Wed, 19 Apr 2006 03:27:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QtcrauvkXxqvT4677VG2yIY+JS+SjtIQwLHwgDpQx6bjQP06vB9EJBXeKwS0cs4/UrQysxZaJ8kgo4brtsLcISKuBEcnosj+2K9oYfGi4x01ydyK+pWdS+bXSV8z7Lq9tmIRE7bPZ8tU+PQ+Az8UOH6LgSntg4lpPeK5u79pj4U= Received: by 10.35.9.2 with SMTP id m2mr1089865pyi; Wed, 19 Apr 2006 03:27:09 -0700 (PDT) Received: by 10.35.116.1 with HTTP; Wed, 19 Apr 2006 03:27:09 -0700 (PDT) Message-ID: <74e15baa0604190327t29b9bcc7t4eb33822a50d53e6@mail.gmail.com> Date: Wed, 19 Apr 2006 06:27:09 -0400 From: "Aaron Mulder" Sender: ammulder@gmail.com To: user@geronimo.apache.org Subject: Re: How to do a local bean lookup In-Reply-To: <785A212E11918F449D1318C61B7A9B0E2B95A3@cs-mailsvr.Virtusa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <785A212E11918F449D1318C61B7A9B0E2B95A3@cs-mailsvr.Virtusa.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The new ejb-local-ref looks right. Maybe you have to swap the order of the ejb-local-ref and the resource-ref? Does the XML parsing error give you any specific information about what it expected vs what it actualy got? You can always consult the schema at geronimo/schemas/ejb-jar_2_1.xsd Thanks, Aaron On 4/19/06, Siraj Mohamed wrote: > > > > Hi All, > > > > I want to do a local lookup of a session bean from another session bean. > This is what I am actually trying to do: > > > > I have two session bean bundled them in the same EAR and in my first bean= 's > method; I do a local lookup of the 2nd bean. This is the code: > > > > Context jndiCntx =3D new InitialContext(); > > Object objref =3D null; > > Demo2Home home =3D null; > > objref =3D jndiCntx.lookup("Demo2"); > > home =3D (Demo2Home)PortableRemoteObject.narrow( > > objref, Demo2Home.class); > > Demo2 demo =3D home.create(); > > > > Now I am invoking the 1st bean's method from a standalone java (remote > client), but I am getting following errors: > > > > javax.naming.NameNotFoundException: Demo2 > > at > com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:108= ) > > at > com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:116= ) > > at > javax.naming.InitialContext.lookup(InitialContext.java:361) > > at ejb.demo.DemoBean.ejbCreate(DemoBean.java:116) > > > > My ejb-jar.xml contains following information. > > > > enterprise-beans> > > > > EJB.]]> > > Demo > > ejb.demo.DemoHome > > ejb.demo.Demo > > ejb.demo.DemoBean > > Stateful > > Bean > > > > > > xmeta_defaultDS > > javax.sql.DataSource > > Container > > > Shareable > > > > > > > > > > EJB.]]> > > Demo2 > > ejb.demo2.Demo2Home > > ejb.demo2.Demo2 > > ejb.demo2.Demo2Bean > > Stateless > > Container > > > > > > > > If I lookup the 2nd bean remotely, it works fine but it does not work > locally. There were some discussion in the forum regarding this and sugge= st > introducing 'ejb-local-ref' tag. I added following for the 1st bean in th= e > ejb-jar.xml. > > > > > > =85=85=85=85=85.. > > > > ejb/Demo2 > > Stateless > > ejb.demo2.Demo2Home > > ejb.demo2.Demo2 > > Demo2 > > > > > > > > After this change, I could not deploy the EAR and getting XML parsing > exception for ejb-jar.xml. Possibly I am doing some thing wrong here. > Appreciate if any one could suggest a solution. > > > > Thanks & Regards, > > Siraj > > > > > >