Sorry - missed it earlier - in the Realm definition, I think it should be just 
resourceName="jdbc/esljsp" - not dataSourceName="jdbc/esljsp"



-----Original Message-----
From: Veniamin Fichin [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 16. J�nner 2003 12:26
To: Tomcat Users List
Subject: Re: javax.naming.NameNotFoundException: Name java: is not bound
in this Context


Roberts, Eric wrote:

> 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");

    Servlet snippet:

--= [ cut ] =--
try {
     javax.naming.InitialContext initCtx=new InitialContext();
     javax.naming.Context envCtx=
       (Context)initCtx.lookup("java:/comp/env");
     javax.sql.DataSource ds=(DataSource)envCtx.lookup("jdbc/esljsp");
}
catch (NamingException ne) {
     out.println(ne);
}
--= [ / cut ] =--

    And it works. But dataSourceName attribute from DataSourceRealm is not.

> Regards
> 
> 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]>

Reply via email to