The toughest aspect of setting up Tomcat and MySQL on a brand new VM is the fact that unless you focus on building server instances all the time, these setups are deceptively easy. I dont think they are. As developers, we perform this task once in a blue moon. So, here's a gotcha.
Following the Grails documentation, I created a war file from the command line, "grails war". The system administrator had spooled up this vm, so i fired up Tomcat and deployed the war file from the "War file to deploy" section of the Tomcat Manager page.
When i clicked the "Start" button,
My grails app was not running.
In Tomcat's logs folder, I cracked open the the stacktrace.log file. Apparently, Tomcat was unable to "Create a sessionFactory". Take this as a grails code word that "it's possible your grails app is not communicating with the database".
After much hair pulling, I figured out a solution to my non-starting app. I started by looking at the Tomcat documentation (figures). I had my doubts that the system administrator had installed the MySQL Connector as mentioned in the docs. Get the appropriate connector and place it in your Tomcat/lib (or $CATALINA_HOME/lib) location. Then, make a reference to the targeted MySQL database in Tomcat's $CATALINA_HOME/conf/context.xml file.
You need to add a reference, like
<Resource name="jdbc/your_db" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="dbUser" password="pass234" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/your_db"/>
It helps to make these configuration changes while Tomcat is not running. After these changes are made, you can deploy the grails app, hit the "Start" button, and you should see "Running"=true.
Good luck,
woof!

