title: Groovy Static Scope
body: <p>I'm attempting to run this script. If I pull it all out of the class, it runs fine. When I wrap it in my "Test" class, I get this error:</p>
  
  <blockquote>
    <p>Apparent variable 'json_users' was found in a static scope but doesn't
    refer to a local variable, static field or class</p>
  </blockquote>
  
  <pre><code>class Test{
  
      def testProc(JsonBuilder json_List) {
  
          println json_List.prettyPrint
  
      }
  
      public static void main(String[] args){
  
          def query = 'Select * from mytable'    
  
          def resultset = sql.rows(query)
  
          json_users = new JsonBuilder(users:resultset)    
  
          testProc(json_users)
      }
  }
  </code></pre>
  
  <p>Any idea why I'm receiving this error?</p>