You need to use a context configuration file.
Go to: http://localhost:8080/manager/html/list Then enter your path in the "Path:" text box and enter file protocol URL in the "Config URL:" text box such as: Path: /myapp Config URL: file:///D:/myclasses/webapps/webapp-myapp/build/WEB-INF/ccf.xml in your ccf.xml, you just have a <Context ...> element and anything that is valid within that context element. Now you have a place to put all your JNDI resource config for you app. You can also use the catalina ant tasks to do this for you. See examples in the tomcat docs (appdev). My install target looks like this: <target name="install" depends="compile,manager.init" description="Install application to servlet container" > <install url="${manager.url}" username="${manager.username}" password="${manager.password}" config="${app.ccf}" path="${app.path}" /> </target> At 01:12 AM 10/16/2002 +0200, you wrote: >Hi all > >I have set up a development environment for tomcat. I am using ant to >install and reload my webapp with the tomcat manager. >I followed the "App Developer Guide" to set it up. > >The basic stuff works just fine. My webapp is "hot" deployed with ant and >I can reload on the fly! >I wanted to setup a JNDI DataSource, so I followed the howto on: >http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html >to do this. > >But since the ant install tool doesn't create a <Context> node in the >server.xml file I can't see how I can define the Resource and >ResourceParams for my JNDI DataSource. >This results in the fact that I am getting the following exception: >------- >java.sql.SQLException: Cannot load JDBC driver class 'null' > at > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou >rce.java:529) > at > org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource >.java:312) > at foo.DBTest.init(DBTest.java:23) >... >--------- >when loading the test.jsp file. > >I tried to setup the Resource as a global resource, but to use that >resource I still need a ResourceLink in the Context of my webapp - right? >Anyway - doing that gave my the same exception. > >Also - I read somewhere that I should remove the resource-ref from my >web.xml file when I use a global resource. But that didn't help either. > >On a final note... When I run "ant dist" and deploy my webapp with the war >file and manually edit the Context node with the Resource and >ResourceParams, then everything works just fine. I would just love to be >able to figure out how to make it work with the ant install thingy. > >Thanks, >Thomas Tolborg > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
