Return-Path: Delivered-To: apmail-geronimo-servicemix-dev-archive@www.apache.org Received: (qmail 6077 invoked from network); 4 Apr 2007 09:44:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Apr 2007 09:44:47 -0000 Received: (qmail 54767 invoked by uid 500); 4 Apr 2007 09:44:54 -0000 Delivered-To: apmail-geronimo-servicemix-dev-archive@geronimo.apache.org Received: (qmail 54759 invoked by uid 500); 4 Apr 2007 09:44:54 -0000 Mailing-List: contact servicemix-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: servicemix-dev@geronimo.apache.org Delivered-To: mailing list servicemix-dev@geronimo.apache.org Received: (qmail 54750 invoked by uid 99); 4 Apr 2007 09:44:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2007 02:44:54 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of gnodet@gmail.com designates 209.85.132.244 as permitted sender) Received: from [209.85.132.244] (HELO an-out-0708.google.com) (209.85.132.244) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2007 02:44:46 -0700 Received: by an-out-0708.google.com with SMTP id b36so200225ana for ; Wed, 04 Apr 2007 02:44:25 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=CHvitqAjJ3eCOXtigyWVGPzgeO8uRgGLIr3wU94KP8KCyqNhM662VRda9duT6bYcBNUyikOIJy1jvfCLNmZ3M1av41MAfgVuPMuVyUVIbETsMTNKcuYRAJCDq5nMZFH0LuXKkigzTbg28C/3IgDeiFN+rwBdLafsdO/9DUR31u8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ajgpPppf+B30eFEJvt2E5QzRfdGttLJxYlVnPV9Gg9e2hybUahS2HBWnKvnJkrywGc7sj9UFvB/wxjL8loOB21C1qkcThqyvqsm0fLMwz2rzGgOJp53PkvjRLE4bzFRQxa7R2QBcB8/yUsQzyC1MY/kdl+AVCTFz1V8KoUBCBU8= Received: by 10.100.178.7 with SMTP id a7mr257109anf.1175679865709; Wed, 04 Apr 2007 02:44:25 -0700 (PDT) Received: by 10.100.121.10 with HTTP; Wed, 4 Apr 2007 02:44:25 -0700 (PDT) Message-ID: Date: Wed, 4 Apr 2007 11:44:25 +0200 From: "Guillaume Nodet" To: servicemix-dev@geronimo.apache.org Subject: Re: Access to JNDI Resources by java code In-Reply-To: <46136198.9020708@blue-elephant-systems.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_23603_22637693.1175679865640" References: <46135F60.8080809@tiscali.it> <46136198.9020708@blue-elephant-systems.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_23603_22637693.1175679865640 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I don't really see why one has to specify these properties, at least when inside ServiceMix standalone, or when using the InitialContext retreived from the ComponentContext. Any idea ? On 4/4/07, Thomas TERMIN wrote: > > Andrea Zoppello wrote: > > Hi to all > > > > I'm asking if there's a way to access Jndi resources (defined in > > jndi.xml ) in the java code of a component/endpoint??? > > That should work. > > private String jndiInitialContextFactory =3D > "org.apache.xbean.spring.jndi.SpringInitialContextFactory"; > private String jndiProviderUrl =3D "classpath:jndi.xml"; > > Hashtable env =3D new Hashtable(); > env.put(Context.INITIAL_CONTEXT_FACTORY, > this.jndiInitialContextFactory); > env.put(Context.PROVIDER_URL, jndiProviderUrl); > > Context ctx =3D new InitialContext(env); > > Cheers, > Thomas > -- > Thomas Termin > _______________________________ > blue elephant systems GmbH > Wollgrasweg 49 > D-70599 Stuttgart > > Tel : (+49) 0711 - 45 10 17 676 > Fax : (+49) 0711 - 45 10 17 573 > WWW : http://www.blue-elephant-systems.com > Email : Thomas.Termin@blue-elephant-systems.com > > blue elephant systems GmbH > Firmensitz : Wollgrasweg 49, D-70599 Stuttgart > Registergericht : Amtsgericht Stuttgart, HRB 24106 > Gesch=E4ftsf=FChrer : Holger Dietrich, Thomas Gentsch, Joachim Hoernle > > --=20 Cheers, Guillaume Nodet ------------------------ Architect, LogicBlaze (http://www.logicblaze.com/) Blog: http://gnodet.blogspot.com/ ------=_Part_23603_22637693.1175679865640--