Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 81503 invoked from network); 29 Jun 2004 12:18:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Jun 2004 12:18:30 -0000 Received: (qmail 19415 invoked by uid 500); 29 Jun 2004 12:18:17 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 19299 invoked by uid 500); 29 Jun 2004 12:18:15 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 19267 invoked by uid 99); 29 Jun 2004 12:18:14 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received: from [140.247.210.252] (HELO latte.harvard.edu) (140.247.210.252) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 29 Jun 2004 05:18:11 -0700 Received: from latte.harvard.edu (207-172-79-45.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com [::ffff:207.172.79.45]) (AUTH: PLAIN mdiggory, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by latte.harvard.edu with esmtp; Tue, 29 Jun 2004 08:18:05 -0400 Message-ID: <40E15E54.3090004@latte.harvard.edu> Date: Tue, 29 Jun 2004 08:19:32 -0400 From: "Mark R. Diggory" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; rv:1.7a) Gecko/20040219 X-Accept-Language: en-us, en, zh, zh-cn, zh-hk, zh-sg, zh-tw MIME-Version: 1.0 To: Favretto Enrico CC: tomcat-dev@jakarta.apache.org Subject: Re: Problems Instantiating JNDI LdapDirContext as resource. References: <031486648BEF2442BC98195A87944F2F077554@sxchs509.csintra.net> In-Reply-To: <031486648BEF2442BC98195A87944F2F077554@sxchs509.csintra.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Enrico, Sure, my solution was to compile my own Factory for creating the InitialDirContext, something like the following and then place it into the tomcatX/common/lib directory. public class MyDirContextFactory implements ObjectFactory, InitialContextFactory { public Object getObjectInstance( Object obj, Name name, Context nameCtx, Hashtable environment) throws NamingException { Hashtable env = new Hashtable(); Reference ref = (Reference) obj; Enumeration addrs = ref.getAll(); while (addrs.hasMoreElements()) { RefAddr addr = (RefAddr) addrs.nextElement(); if(!addr.getType().equals("factory")) env.put(addr.getType(), addr.getContent().toString()); } return this.getInitialContext(env); } /* (non-Javadoc) * @see javax.naming.spi.InitialContextFactory#getInitialContext(java.util.Hashtable) */ public Context getInitialContext(Hashtable environment) throws NamingException { return new InitialDirContext(environment); } } hope this helps, Mark Favretto Enrico wrote: > Hello Mark > > Please excuse me for sending you this unsolicited email. However, I'm having > exactly the same problem and by searching the web for a possible solution I > found your post on the tomcat-dev mailinglist > (http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg51159.html). > May I ask you if you managed to come up with a solution? > > kind regards > Enrico Favretto > > -------------------------------------------- > Enrico Favretto > Corporate Center & Common Applications > e-Applications > Phone +41-52-261-7730 > Fax +41-52-261-3148 > mailto:enrico.favretto@winterthur.ch > -------------------------------------------- > Winterthur Insurance > G�rtnerstrasse 4a, WICC 23 > CH-8401 Winterthur > http://www.winterthur.com/ > -------------------------------------------- -- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org