You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/03/18 19:54:24 UTC

DO NOT REPLY [Bug 16316] - DataSourceRealm can not find JNDI name in context

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16316>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16316

DataSourceRealm can not find JNDI name in context

sideshowfry@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CLOSED                      |REOPENED
         Resolution|FIXED                       |



------- Additional Comments From sideshowfry@yahoo.com  2003-03-18 18:54 -------
I've made my own realm which uses DataSource, based on the DataSourceRealm code,
and dealt with the

   javax.naming.NameNotFoundException: Name java: is not bound in this Context

problem. In addition to removing the connection check from the start method (as
Glenn indicated), I also changed these lines in open():

   StandardServer server = (StandardServer) ServerFactory.getServer();
   Context context = server.getGlobalNamingContext();

to:

   Context context = new InitialContext();

I think this is what allowed me to put my realm and datasource within the
context of my webapp, rather than in GlobalNamingResources.  This seems like a
worthwhile change to me. On the other hand, the InitialContext class is
imported, but not used, in DataSourceRealm - so, maybe my way had problems in
the past that were corrected with the getGlobalNamingContext() approach.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org