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/[EMAIL PROTECTED]/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:[EMAIL PROTECTED] -------------------------------------------- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]