tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Dangerfield <dan...@lvcm.com>
Subject Re: Tomcat/Ant/JNDI question
Date Tue, 17 Jun 2003 22:21:46 GMT
I tried this and it's not giving me the "not found in Context" message, 
but it's now trying to pass me a null connection.

I think the problem is that it doesn't know where to get the connection 
from.

With the ResourceLink in the server.xml Context, one specifies the name 
one wants to use locally as well as the name of the global resource. The 
resource-ref doesn't allow this.

Any further thoughts?

Thanks,
Garrett Dangerfield.

Tim Shaw wrote:

> This works for me ...
>
> web.xml :
> <resource-ref>
> <description>
> Resource reference to a factory for java.sql.Connection
> instances that may be used for talking to a particular
> database that is configured in the server.xml file.
> </description>
> <res-ref-name>
> jdbc/SessionDB
> </res-ref-name>
> <res-type>
> javax.sql.DataSource
> </res-type>
> <res-auth>
> Container
> </res-auth>
> </resource-ref>
>
> context.xml :
> <snip>
> <Resource name="jdbc/SessionDB" auth="Container"
> type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/SessionDB">
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
>
> <parameter>
> <name>username</name>
> <value>tripleplay</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value></value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>com.mysql.jdbc.Driver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbc:mysql://vodmgr:3306/tripleplay</value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>20</value>
> </parameter>
> <parameter>
> <name>maxIdle</name>
> <value>20</value>
> </parameter>
> <parameter>
> <name>maxWait</name>
> <value>5000</value>
> </parameter>
> </ResourceParams>
> </snip>
>
> Garrett Dangerfield wrote:
>
>> I tried this and it's not working.
>>
>> It's saying:
>> Name jdbc not found in this context
>>
>> In my web.xml, I put in:
>>
>> <env-entry>
>> <env-entry-name>jdbc/DataWarehouse</env-entry-name>
>> <env-entry-value>jdbc/DataWarehouse</env-entry-value>
>> <env-entry-type>javax.sql.DataSource</env-entry-type>
>> </env-entry>
>>
>> In my server.xml, I have:
>>
>> <Resource auth="Container" name="jdbc/DataWarehouse" scope="Shareable"
>> type="javax.sql.DataSource"/>
>>
>> Am I missing something?
>>
>> Thanks
>> Garrett Dangerfield.
>>
>> Shapira, Yoav wrote:
>>
>>> Howdy,
>>>
>>>
>>>
>>>> - put the equivalent of ResourceEnvRef into the web.xml inside the web
>>>
>>>
>>> app
>>>
>>> See the <env-entry> element in the Servlet Specification, v2.3,
>>> SRC.13.1.
>>>
>>> Yoav Shapira
>>>
>>>
>>>
>>> This e-mail, including any attachments, is a confidential business 
>>> communication, and may contain information that is confidential, 
>>> proprietary and/or privileged. This e-mail is intended only for the 
>>> individual(s) to whom it is addressed, and may not be saved, copied, 
>>> printed, disclosed or used by anyone else. If you are not the(an) 
>>> intended recipient, please immediately delete this e-mail from your 
>>> computer system and notify the sender. Thank you.
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message