tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GB Developer" <>
Subject RE: Trouble finding Datsource Resource with DataSourceRealm
Date Thu, 20 Oct 2005 14:55:48 GMT
I should have mentioned, I have a ContextListener that contains the

initCtx = new InitialContext();
envCtx  = (Context) initCtx.lookup("java:comp/env");"*** loading Data Source");
try {
	ds = (DataSource) envCtx.lookup("sql/DataSource");
	application.setAttribute("services.datasource", ds);"*** DataSource loaded @ services.datasource");
} catch (NamingException ne) {
	logger.fatal("ERROR loading DataSource: ", ne);

And I get both 'info' messages.  So the DataSource resource is being loaded,
and it *can* be found at "sql/DataSource" (by my code in the context
listener).  It's just the Realm that can't seem to find it, as indicated by
the stacktrace below.

However, leaving no stone un-turned, I deleted the entire work directory for
the 'foo' host and get the same result. 

This still appears in the engine log when I attempt to authenticate: 

2005-10-20 09:51:15 DataSourceRealm[]: Exception performing authentication
javax.naming.NameNotFoundException: Name sql is not bound in this Context
  at org.apache.naming.NamingContext.lookup(
  at org.apache.naming.NamingContext.lookup(

> -----Original Message-----
> From: Stanley Bradbury [] 
> Sent: Wednesday, October 19, 2005 8:07 PM
> To: Tomcat Users List
> Subject: Re: Trouble finding Datsource Resource with DataSourceRealm
< big snip />

> >
> Hi -
> I had a similar problem (with 5.5.12) that turned out to be 
> related to 
> restart persistence (see post 10/17 Subj: "Odd problem with Restart 
> Persistance..." for more info).  You can do a quick test by 
> deleting the 
> SESSIONS.ser file in<myWebApp> 
> (or whatever 
> name and host relates to your installation) - start Tomcat and see if 
> the datasource is found.  If so, you will want to disable restart 
> persistance for this App (see my note for more info).
> Hope this Helps

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

View raw message