title: Grails Enum Works on Jetty, breaks on Tomcat
body: <p>I have developed this small app and run it on Jetty with no problems...</p>
  
  <p>Bug.groovy:</p>
  
  <pre><code>package itsafeature
  
  class Bug {
  
      String name
      String description
      Priority priority
  
      Project project
  
      static belongsTo = Project
  
      static constraints = {
          name(size:10..150)
          description(size:25..1500)
          project(nullable:false)
          priority(nullable:false)
      }
  
      String toString() {
          return "${priority}:${name}"
      }
  }
  enum Priority {HIGH(5), MEDIUM(3),LOW(1)
      private Priority(int val){
          value = val
      }
      private final int value
      int value() {
          value
      }
  }
  </code></pre>
  
  <p>When I use Netbeans to deploy directly to it's Grails Jetty Server, this works exactly as you'd expect.  The Priority is written to my database as a string, and it does what I want.</p>
  
  <p>However, If I take the project and do a "build", it creates a "production" build of the application (my datasource file is the same for all builds), and I put it in my "webapps" folder of a local tomcat server, and I see the following stacktrace:</p>
  
  <pre><code>SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
          ... SNIP! ...
  Caused by: java.lang.ExceptionInInitializerError
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:247)
  Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: Priority(java.lang.String, java.lang.Integer)
          at Priority.&lt;clinit&gt;(Priority.groovy:10)
          ... 2 more
  </code></pre>
  
  <p>What should I be looking at to narrow down this issue?  I only have one groovy installed on windows, with the GROOVY_HOME pointed to that, same with GRAILS.  Does Jetty have it's own version of these runtimes?  Or is this really an application server problem?</p>
  
  <p>There is a grails command that says "tomcat", not sure if that has anything to do with this, but I'm not using it</p>