Hello Nico,
Yes I've been attempting to do the same thing with suns LDAP Context.
Unfortunately (even for myself as an Apache Jakarta Developer, neither
the tomcat user or developer lists have gotten any responses to my emails).
I've done several attempts to start a discussion on this, maybe you will
find my "mistake path" helpful:
Tomcat User:
http://www.mail-archive.com/tomcat-user@(protected)
http://www.mail-archive.com/tomcat-user@(protected)
Tomcat Dev:
http://www.mail-archive.com/tomcat-dev@(protected)
The nearest I can figure out is that you may have to write your own
object factory to instantiate the objects even if one is provided by
Sun. Otherwise your really going to be troubled with what ResourceParams
are actually getting configured into the federated Context. I actually
had to decompile the ldap factory
com.sun.jndi.ldap.LdapCtxFactory to
identify the fact that it sets none of these
ReferenceAddrs/ResourceParams properly into the environment of the new
context.
If your studying all the JNDI Tutorial stuff and documentation its
important to note that whats really getting set when you create Resource
Params like this are Reference/ReferenceAddrs in JNDI.
<Resource type="
com.sun.jndi.ldap.LdapCtxFactory" auth="Container"
name="ldap"/>
<ResourceParams name="ldap">
<parameter>
<name>java.naming.factory.initial</name>
<value>
com.sun.jndi.ldap.LdapCtxFactory</value>
</parameter>
</ResourceParams>
equates to:
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);
in the factory (which all kinda sucks for anyone trying to use an
existing factory that may not actually do this consistently.
Unfortunately the JNDI tutorial is rather weak in substance when it
comes to actually federating two namespaces.
http://java.sun.com/products/jndi/tutorial/objects/factory/reference.html
http://java.sun.com/products/jndi/tutorial/beyond/fed/index.html
Good Luck, I'm glad to chat with someone having a similar problem.
-Mark Diggory
Nicolas De Loof wrote:
> Hello,
>
> I would like to use tomcat JNDI to lookup JMS Queues (MQSeries) that are registered in JNDI using a File System JNDI
> Context (com.sun.jndi.fscontext.RefFSContextFactory)
>
> My webapp refers to a JNDI resource named "jms/testQueueConnectionFactory", and I need to configure tomcat internal JNDI
> to federate "java:com/env/jms" JNDI namespace to the FileSystem JNDI context.
>
> I've not find any example in mailing-list archive about this. Can anyone tell me How to configure tomcat to do this ?
>
> Nico.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> For additional commands, e-mail: tomcat-user-help@(protected)
>
--
Mark Diggory
Software Developer
Harvard MIT Data Center
http://osprey.hmdc.harvard.edu
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)