I am trying to use a J2EE datasource, but am having troubles.
Environment:
Cocoon 2.0.3
Jakarta Tomcat 4.1.9
Sun JDK 1.3.1
Solaris 8
I have defined a datasource in Tomcat via the Administrator interface.
It has put the following in server.xml, under the appropriate Context:
<Resource name="resl" scope="Shareable"
type="javax.sql.DataSource"/>
<ResourceParams name="resl">
<parameter>
<name>validationQuery</name>
<value>select 1 from dual</value>
</parameter>
<parameter>
<name>user</name>
<value>resl</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@ias:1521:ORCL</value>
</parameter>
<parameter>
<name>password</name>
<value>xxxxxxx</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracl.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
</ResourceParams>
These are the parameters I used with the jdbc datasource and they worked
well.
I have added the following datasource definition in cocoon.xconf:
<j2ee name="resl">
<dbname>resl</dbname>
</j2ee>
but when I try to use the datasource in XSP, I get the following error:
org.apache.avalon.framework.component.ComponentException: Could not find
component
Browsing through error.log, I think I found the origin of the problem here:
ERROR (2002-09-23) 18:10.42:478 [core.manager] (Unknown-URI)
Unknown-thread/J2eeDataSource: Problem with JNDI lookup of datasource
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at
org.apache.avalon.excalibur.datasource.J2eeDataSource.configure(J2eeDataSource.java:95)
...
I am afraid I am doing something wrong, but the docs, either the Cocoon
or the Tomcat ones don't help much.
Ugo
--
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>