tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arthur T Smyles" <>
Subject Re: Custom ObjectFactory w\ Tomcat 4.0beta1
Date Tue, 30 Jan 2001 22:31:21 GMT
Thanks for you quick response. It has though brought about more questions. For
example, if I had the following code

Hashtable env=new Hashtable();



DirContext root=new InitialDirContext(env);

According to the JNDI spec the object and state factories from this environment
should be added to the application resource properties and the system properties
 for this context. It should have no effect on any other contexts from any other
By not following this convention, it forces me to do things in a Tomcat specific
 way.What are the issues that prevent Tomcat from following this convention?
Also, I took a look at org.apache.naming packages but I am unsure which classes
are affecting this?

Arthur on 01/30/2001 04:36:33 PM

Please respond to

cc:   (bcc: Arthur T Smyles)
Subject:  Re: Custom ObjectFactory w\ Tomcat 4.0beta1

> I developed an JNDI ObjectFactory that is used to read User Objects from
> When I run a test program and perform a lookup it works fine. But when I
use it
> within Tomcat 4.0 it ignores the java.naming.factory.object and
> java.naming.factory.state attributes that I am setting when creating the
> InitialContext. Does anyone have any ideas why these attributes are
> ignored? Any help would be appreciated.

First of all, the object factories are not pluggable in b1 without modifying
some code in the naming.factory package (although the modifications are
quite simple). That has been added since then, and b2 will have pluggable
factories. However, it will not use the standard mechanism for a variety of
reasons (static mechanism - that's bad if like here you're supposed to have
isolated independant contexts -, not flexible enough, classloading issues,

Instead, the reference is always processed through a set of proxy object
factories. In b2, you can use the "factory" parameter to specify a custom
store. This is done in server.xml like this :

          <ResourceParams name="jdbc/MyDataSource">

            <!-- Then add whatever other parameters your factory will
need -->


To unsubscribe, e-mail:
For additional commands, email:

This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co. Incorporated, its
subsidiaries and affiliates.

View raw message