# Instructions to run the Jetty JNDI demo

If you are viewing this page, then you need to perform a couple of configuration tasks before the demo will be available. It is important that you follow the steps in the order given so that Jetty can hot-redeploy this demonstration webapp.

1. Ensure that you have installed the jars for the transaction manager of your choice in $JETTY_HOME/lib/ext. This demo has been tested with JOTM and Atomikos.
2. Ensure that you have installed the database of your choice - this demo assumes that you will use Derby. If you wish to use a different database, then you will need to edit the $jetty.home/etc/test-jndi.xml file and the $jetty.home/etc/test-jndi.d/WEB-INF/jetty-env.xml files and replace the references to Derby with your chosen database.
3. Edit >$jetty.home/etc/test-jndi.d/WEB-INF/jetty-env.xml and uncomment the transaction manager setup of your choice. Save the file.
4. Edit $jetty.home/etc/test-jndi.xml and:
   - Uncomment the transaction manager setup of your choice, replacing any references to Derby if you are using a different database
   - If you want to use the mail-sending demonstration, change the smtp authentication information appropriately for your environment on the mail/Session Resource.
   - Remove the line <Set name="descriptor"><SystemProperty name="jetty.home" default="."/>/contexts/test-jndi.d/WEB-INF/instruction-web.xml</Set>.
   - Save the file

This webapp should now be automatically hot redeployed and the demonstration will be available to you. If not, then you may need to stop and restart jetty.