 <p>Check your main method:</p> <pre><code>public static void main(String[] args) throws Exception { new Test().searchBetweenDates(startDate, endDate); searchBetweenDates(startDate, endDate); </code></pre> <p>the parenthesis is missing. It should be:</p> <pre><code>public static void main(String[] args) throws Exception { new Test().searchBetweenDates(startDate, endDate); searchBetweenDates(startDate, endDate); } </code></pre>