Return-Path: Delivered-To: apmail-geronimo-servicemix-dev-archive@www.apache.org Received: (qmail 18131 invoked from network); 4 Apr 2007 10:06:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Apr 2007 10:06:53 -0000 Received: (qmail 85637 invoked by uid 500); 4 Apr 2007 10:07:00 -0000 Delivered-To: apmail-geronimo-servicemix-dev-archive@geronimo.apache.org Received: (qmail 85621 invoked by uid 500); 4 Apr 2007 10:06:59 -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 85610 invoked by uid 99); 4 Apr 2007 10:06:59 -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 03:06:59 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [213.174.32.97] (HELO mailout02.ims-firmen.de) (213.174.32.97) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2007 03:06:51 -0700 Received: from mailin04.ims-firmen.de ([192.168.1.113]) by mailout02.ims-firmen.de with esmtp (Exim 4.66) (envelope-from ) id 1HZ2Np-0001vW-UK for servicemix-dev@geronimo.apache.org; Wed, 04 Apr 2007 12:06:29 +0200 Received: from [212.202.229.86] (helo=[192.168.123.116]) by mailin04.ims-firmen.de with esmtpa (Exim 4.66) (envelope-from ) id 1HZ2Np-0003TX-KG for servicemix-dev@geronimo.apache.org; Wed, 04 Apr 2007 12:06:29 +0200 Message-ID: <461378A3.9050809@blue-elephant-systems.com> Date: Wed, 04 Apr 2007 12:06:27 +0200 From: Thomas TERMIN User-Agent: Thunderbird 1.5.0.5 (X11/20060725) MIME-Version: 1.0 To: servicemix-dev@geronimo.apache.org Subject: Re: Access to JNDI Resources by java code References: <46135F60.8080809@tiscali.it> <46136198.9020708@blue-elephant-systems.com> <4613772C.8050503@blue-elephant-systems.com> In-Reply-To: <4613772C.8050503@blue-elephant-systems.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org I've corrected this. :-) Thomas TERMIN wrote: > What you mean is that: > > getContext().getNamingContext() > > should work and is also the better way if it is inside of a component. > > I read the mail to fast I guess. > > What also works inside the same vm is just: new InitialContext() > > Cheers, > Thomas > > Guillaume Nodet wrote: >> 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 = >>> "org.apache.xbean.spring.jndi.SpringInitialContextFactory"; >>> private String jndiProviderUrl = "classpath:jndi.xml"; >>> >>> Hashtable env = new Hashtable(); >>> env.put(Context.INITIAL_CONTEXT_FACTORY, >>> this.jndiInitialContextFactory); >>> env.put(Context.PROVIDER_URL, jndiProviderUrl); >>> >>> Context ctx = 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�ftsf�hrer : Holger Dietrich, Thomas Gentsch, Joachim Hoernle >>> >>> >> > > -- 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�ftsf�hrer : Holger Dietrich, Thomas Gentsch, Joachim Hoernle