Roberts, Eric wrote:

Sorry - missed it earlier - in the Realm definition, I think it should be just resourceName="jdbc/esljsp" - not dataSourceName="jdbc/esljsp"
That's odd. There is no "resourceName" attribute in DataSourceRealm documentation. I looked at the source of it and saw (set|get)DataSourceName only.
And I see that tomcat docs is wrong in DataSourceRealm description, because attribute list there is not reflect real things in code.
Now I'm trying to look into the sources, but I'm not so hacky...

-----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 ] =--
--
Veniamin Fichin  <[EMAIL PROTECTED]>
Programmer at    http://www.rbcsoft.ru/


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to