There are two pieces of information about the Context file while deploying your application as a WAR that the Tomcat documentation fails to make absolutely clear:
1) the Context file name must be "context.xml"; do not attempt to name it anything else. 2) put the file in the /WEB-INF folder of the WAR The file will be extracted and the name changed automatically by the Tomcat engine. Other than that, what Mr. Stepanenko gave you is relatively identical to what I have in my Context file. H On 9/23/06, Andrew Stepanenko <[EMAIL PROTECTED]> wrote:
Hello, looks like the docs I gave a link to describe the old approach, sorry. Here is what I have in my context.xml: ###### <!-- The contents of this file will be loaded for each web application --> <Context path="" docBase="/export/home/andrews/dev/unfas/web" debug="1" reloadable="true"> <!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name="jdbc/unfasHB" auth="Container" scope="Shareable" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" url="jdbc:mysql://localhost:3306/unfas?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8" driverClassName="com.mysql.jdbc.Driver" username="andrews" password="xxx" maxIdle="5" maxActive="50" autoReconnect="true" /> </Context> ##### also, the format of <Resource> has been changed. Now, all configuration data should be provided as attributes and not nested tags. Regards, Andrew Stepanenko, http://unf.tane.edu.ua On 9/23/06, Alan Chandler <[EMAIL PROTECTED]> wrote: > On Saturday 23 September 2006 09:57, Andrew Stepanenko wrote: > > Hello, > > > > there is a difference between how resources are defined in 5.0 and > > 5.5. In 5.0 you could provide your resource definitions right in the > > server.xml, but in 5.5 you need to create a separate context.xml file > > ($CATALINA_HOME/conf/Catalina/<hostname>/context.xml) and put resource > > definitions there. > > See this link: > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html > > > > I also had this problem when migrating from 5.0 to 5.5. After I > > defined a separate context.xml it started to work again. > > The docs seem very vague on this issue, but it does imply that I could still > use $CATALINA_HOME/conf/server.xml > > One question that isn't answered in the docs is what the root element should > be - the best seems to be the example for accessing a database, and even > there it puts <Context ...> > > I tried with context.xml in the directory you mentioned and it said it > couldn't find the webapp "context", so I renamed it to my application and > tried again. But it didn't work. > > So still stumped > > -- > Alan Chandler > http://www.chandlerfamily.org.uk > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Andrew Stepanenko, Ph.D. student, Dept. of Information Computing Systems and Control, Web: http://www.tanet.edu.te.ua/icsc/ Software engineer, Ukrainian-Dutch Faculty of Economics and Management Ternopil State Economic University Shevchenko Street 9, Office 24-25 Ternopil, 46000 UKRAINE Tel: +38 (0352) 43 52 41 fax: +38 (0352) 43 52 45 Web: http://unf.tane.edu.ua --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Henry McClain "Life is hard. Wear a helmet" "Tell your wife that she looks pretty, even if she looks like a truck." --