opscode-cookbooks/tomcat — pull request #34 by olarivain (2013-08-04 23:35:33+00:00)
Title: Tomcat 7 and issue with JVM_OPTS

Hey,

This pull request fixes a couple of things:
* typos in b0d0nne11's pull request that added tomcat7 support. Some variables are names "tomcatN" or still referenced the (non existing) tomcat6 installation folders.
* fixes an issue where if the JVM options where causing tomcat to fail starting, any subsequent chef run would not be able to restart tomcat, even if said JVM options were fixed.

to reproduce this issue:
# update node's node["tomcat"]["java_options"] to have invalid options. In my case, enabling JMX remote port without updating the default jmx password file permissions (/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management/jmxremote.password), nor disabling authentication. This will cause tomcat to fail to start due to loose permissions on the password file.
# update the node's tomcat java_options to now have valid options and sudo chef-client
# the recipe tries to start tomcat before setting the new default JVM options. Since the options are invalid, tomcat fails to start and causes the chef run to abort with an exception. The only way out at this point is to manually update /etc/default/tomcat7 (ubuntu 12.04) and rerun chef with the valid options.