Yes, but the resource name is jdbc/esljsp - java:comp/env/jdbc/esljsp would be used in
a servlet using JNDI such as:
ctx = new InitialContext();
Context envCtx = (Context) ctx.lookup("java:/comp/env/");
DataSource ds = (DataSource) envCtx.lookup("/jdbc/esljsp");
Regards
Eric
-----Original Message-----
From: Veniamin Fichin [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 16. J�nner 2003 11:53
To: Tomcat Users List
Subject: Re: javax.naming.NameNotFoundException: Name java: is not bound
in this Context
Thanks for your reply!
See below...
Roberts, Eric wrote:
> Hi,
>
> Try this:
>
> First define your DataSource resource e.g.
> <Resource name="jdbc/esljsp" auth="Container" scope="Shareable"
>type="javax.sql.DataSource"/>
>
> and add the necessary <ResourceParams name="jdbc/esljsp">
> and the parameters.
> then define your Realm using:
>
> dataSourceName="jdbc/esljsp"
I already have these lines in config.xml:
--= [ server.xml ] =--
<Resource name="jdbc/esljsp"
type="javax.sql.DataSource"
auth="Container"
scope="Shareable"
description="Database resource for esljsp project" />
<ResourceParams name="jdbc/esljsp">
<!-- various parameters not shown here -->
</ResourceParams>
<Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="java:/comp/env/jdbc/esljsp"
debug="5"
userTable="T_USERS"
userNameCol="NAME"
userCredCol="PASSWORD"
userRolesTable="T_USERROLES"
roleNameCol="ROLENAME" />
--= [ / server.xml ] =--
If I haven't them there, I wouldn't be able to connect to database
in my servlets, getting DataSource through JNDI. But servlets work just
fine.
And exception is thrown while Tomcat starts up, telling me that
"java:" name is not found, so this must not be configuration problem.
> HTH
>
> Eric
>
> -----Original Message-----
--= [ cut ] =--
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>