You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Kevin Williams <ke...@qwest.net> on 2006/05/10 00:47:32 UTC
Auto config of Datasource
I am trying to modify the set up in java/testing/tomcat to define a
Datasource that the stand-alone DAS sample can then reference.
Currently, the stand-alone sample requires the user to use the tomcat
manager to install the war like this:
Context Path (optional): /CompanyApp
XML Configuration file URL: work/CompanyAppGbl.xml
WAR or Directory URL: work/CompanyWeb-SNAPSHOT.war
CompanyAppGbl.xml looks like this:
<Context path="/CompanyApp" debug="5" reloadable="true"
crossContext="true">
<Manager pathname=""/>
<ResourceLink name="jdbc/dastest"
global="jdbc/dastest"
type="javax.sql.DataSource" />
</Context>
To mimic what i think the manager does with this info I modified the
build.xml file to copy the sample war to the webapps directory and added
a file named "companyWeb-SNAPSHOT.xml" to /conf/localhost with the
following contents:
<Context path="webapps/companyWeb-SNAPSHOT" debug="5"
reloadable="true" crossContext="true">
<Manager pathname=""/>
<ResourceLink name="jdbc/dastest"
global="jdbc/dastest"
type="javax.sql.DataSource" />
</Context>
The conf/server.xml has been modified to include and entry like this:
<!-- Global Datasource for Derby dastest database -->
<Resource name="jdbc/dastest"
type="javax.sql.DataSource" auth="Container"
description="Derby database for DAS Company sample"
maxActive="100" maxIdle="30" maxWait="10000"
username="" password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:Databases/dastest"/>
This does not seem to work since the application is unable to look up
the Datasource.
Any ideas?
Thanks,
---Kevin