Iran,
Did you try changing 

<Context docBase="S:\WebAppTests" path="/tests" reloadable="true"
privileged="false" debug="4">

To 

<Context docBase="S:\WebAppTests" path="/tests" reloadable="true"
naming="true" privileged="false" debug="4">


When I first setup naming, I was trying to use the default context.
What I found is that I had to define
The <DefaultContext> value soley for the purpose of the <...
naming="true"> to enable JNDI.


I haven't followed the thread, so perhaps you've already tried this.

Sincerely,
Pantek Incorporated
Justin L. Spies

URI: http://www.pantek.com
Ph   440.519.1802
Fax  440.248.5274
Cell 440.336.3317 


-----Original Message-----
From: Iran Marcius [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 20, 2002 2:32 PM
To: [EMAIL PROTECTED]
Subject: Still can't get JNDI DataSource


Well, I apologize for the insistence but didn't get any answer that
could help me.

Lets remember: I'm trying to get a DataSource in my webapp which is
configured as a GlobalResource, as the following:

<Resource name="jdbc/global" type="javax.sql.DataSource"
auth="Container" scope="Shareable"/> <ResourceParams name="jdbc/global">
        <parameter>
                <name>factory</name>
        
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <parameter>
                <name>driverClassName</name>
                <value>org.postgresql.Driver</value>
        </parameter>
        <parameter>
                <name>url</name>
                <value>jdbc:postgresql://localhost/global</value>
        </parameter>
        <parameter>
                <name>validationQuery</name>  
                <value>select 1</value>
        </parameter>
        <parameter>
                <name>username</name>
                <value>global</value>
        </parameter>
        <parameter>
                <name>password</name>
                <value>password</value>
        </parameter>
</ResourceParams>

My context is like this:

<Context docBase="S:\WebAppTests" path="/tests" reloadable="true"
privileged="false" debug="4">
        <ResourceLink name="db" global="jdbc/global"
type="javax.sql.DataSource"/> </Context>

My webapp has the following lines:

Context ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("java:comp/env/db"); <-- here is
where the exception occurs

The DataSource is there (I saw it in Administration app), and the
ResourceLink is there too.

So what am I missing here?

iran


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