tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GB Developer" <gb107...@globallyboundless.com>
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
following:

-----------------------------------------------------------
initCtx = new InitialContext();
envCtx  = (Context) initCtx.lookup("java:comp/env");

logger.info("*** loading Data Source");
try {
	ds = (DataSource) envCtx.lookup("sql/DataSource");
	application.setAttribute("services.datasource", ds);
	logger.info("*** 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(NamingContext.java:768)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
  at
org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:437)
  at
org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:
277)
  at
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe
nticator.java:129)



> -----Original Message-----
> From: Stanley Bradbury [mailto:Stan.Bradbury@gmail.com] 
> 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 ...work/Catalina/localhost/<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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message