Unknown Syntax Error for Groovy File <p>I'm working on a site with CRUD capabilities for a school project. We're using angular, JSON groovy and MySql for the project. I'm using this code in an HTML file:</p> <pre><code>$scope.getUsers=function(){ $scope.employees=$http.get('getUsers.groovy').success(function(response){ return response.data } </code></pre> <p>When I run the html page and call the getUser function, I get this error: </p> <blockquote> <p>syntax error getUsers.groovy:1</p> </blockquote> <p>The code in the groovy file seems correct:</p> <pre><code> import groovy.sql.Sql import flexjson.JSONSerializer; import org.json.JSONArray; import org.json.JSONObject; import java.sql.SQLException; import java.sql.ResultSet; import java.sql.ResultSetMetaData; System.out.println("Arrived users"); JSONSerializer serializer = new JSONSerializer(); response.setHeader("Access-Control-Allow-Origin", "*"); sql = Sql.newInstance("jdbc:mysql://localhost:8080/test", "root","", "com.mysql.jdbc.Driver") def query="select c.id,c.Name, c.Address, c.Department from people c order by c.id"; JSONArray json = new JSONArray(); sql.eachRow(query) {row-&gt; JSONObject obj = new JSONObject(); obj.put("id",row.id); obj.put("name",row.Name); obj.put("address",row.Address); obj.put("dept",row.Department); json.put(obj); } out&lt;&lt; json; </code></pre> <p>Any help would be greatly appreciated!! It's for my final project</p>