From user-return-8759-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Tue Jan 08 18:27:43 2008 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 12580 invoked from network); 8 Jan 2008 18:27:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2008 18:27:43 -0000 Received: (qmail 65781 invoked by uid 500); 8 Jan 2008 18:27:26 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 65755 invoked by uid 500); 8 Jan 2008 18:27:26 -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 65744 invoked by uid 99); 8 Jan 2008 18:27:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2008 10:27:26 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [69.147.95.77] (HELO smtp114.plus.mail.sp1.yahoo.com) (69.147.95.77) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 08 Jan 2008 18:27:11 +0000 Received: (qmail 30891 invoked from network); 8 Jan 2008 18:27:03 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=rjznE2gaBdeqlAS7xVQrXsKMAUxbgT9hom5SI3dyWyFH6O3dAMe+tDHi3r+ZUmsy0gpFULndrH07SpLfVwKxHt821bjai6XlzGNu24a+KhsNzYym3Ty5NXLJwY6A1/y+BqJGjL/KOlVZGWXnJpwSiFfSoRlP+vlVFmo6wy8HuoM= ; Received: from unknown (HELO ?192.168.1.103?) (david_jencks@67.102.173.8 with plain) by smtp114.plus.mail.sp1.yahoo.com with SMTP; 8 Jan 2008 18:27:02 -0000 X-YMail-OSG: W1jfHP4VM1lIoOZdyWLspqVJ4ONyOaOnL3G9DCh931KLC1k6VB5Ovxy2MZNYqNSy_sLlF1I2Rvdgi5W3YGygrjG6QEAc0mEQulB.fjy01KEX0VB1cA-- Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <14685205.post@talk.nabble.com> References: <14615530.post@talk.nabble.com> <91738B4E-D35A-4AC4-9259-309F861754AD@yahoo.com> <14683996.post@talk.nabble.com> <1b5bfeb50801072352o2560b4ecob8c644865541212b@mail.gmail.com> <14685205.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <8D9E6C44-A89D-4D2E-8998-EAFAF774CF44@yahoo.com> Content-Transfer-Encoding: quoted-printable From: David Jencks Subject: Re: Gbean and EJBs Date: Tue, 8 Jan 2008 10:27:05 -0800 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org On Jan 8, 2008, at 1:34 AM, ivanrc wrote: > > I doesn=B4t work. I can obtain EJB local interface. I think this =20 > lines work as > if I do new InitialContext() without parameters. > > I would like to obtain the interface as we do with EJB 3.0. I try =20 > it adding > this lines to source code... This absolutely definitely will not work. GBeans are lower-level =20 server components that aren't really expected to use jndi (for =20 instance the jndi system is set up with a few gbeans), and we =20 certainly don't provide jndi-based dependency injection through =20 annotations for them. You have to look up the ejb in jndi "by =20 hand". I would recommend using "new InitialContext()" if you can get =20= it to work since you can arrange for other things like datasources to =20= be available there as well, whereas with the openejb jndi system I =20 don't think datasources are available. thanks david jencks > > @EJB(name=3D"TeamBeanRemote") > TeamRemote local=3Dnull; > > -- and adding a ejb-ref to gbean tag as this: > > > > 4201 > localhost > > TeamBeanRemote > xmlns:nam=3D"http://geronimo.apache.org/xml/ns/naming-1.1"> > test_ejb3 > test_ejb3 > > > > > > .. but It doesn=B4t work. Can I use EJB3.0 annotations inside Gbean? > > > > Jacek Laskowski wrote: >> >> On Jan 8, 2008 8:24 AM, ivanrc wrote: >> >>> How can Gbean obtain the global jndi? >> >> During "the simplest and easiest approaches" day everything should be >> simplest and easiest (as well as intuitive) so your best bet would be >> to look at gbean as any other java remote client and do the =20 >> following: >> >> Properties properties =3D new Properties(); >> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, >> "org.apache.openejb.client.LocalInitialContextFactory"); >> >> Context ctx =3D new InitialContext(properties); >> MyEjbBeanIntf myEjbBean =3D (MyEjbBeanIntf) >> ctx.lookup("MyEjbBeanLocal"); >> >> As the gbean's actually part of the server environment, I'd expect =20= >> you >> can leave off the Context.INITIAL_CONTEXT_FACTORY setting and look up >> ejbs without it. >> >> Jacek >> >> --=20 >> Jacek Laskowski >> http://www.JacekLaskowski.pl >> >> > > --=20 > View this message in context: http://www.nabble.com/Gbean-and-EJBs-=20 > tp14615530s134p14685205.html > Sent from the Apache Geronimo - Users mailing list archive at =20 > Nabble.com. >