So working with grails run-app VS war file.
My expectation was that all I have to do to generate a war file and throw it into Tomcat was to type in war
Code below works fine on the RUN-APP console. Code stripped down to what is not working.
package foo
import groovy.sql.Sql;
class FooAlertJob {
static triggers = {
simple name: 'mySimpleTrigger', startDelay:5000, repeatInterval: 1000*10l
}
def dataSourceFoo
def execute() {
def sql = new Sql (dataSourceFoo)
}
}
When running with tomcat and a war file built from grails I am getting (pasted below)
Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [interface javax.sql.DataSource] [interface java.sql.Connection]]
Googling around I did not find a solution so perhaps I am just dense.
What do I have to do to my groovy so that when I generate a war file I do not have to worry about re-testing it all ?
I have tried the obvious about fully qualifying sql as groovy.sql.SQL but I do not have a clear example of working code from run-app to war file.
Also frustrating is the groovy / grails docs does not even mention it so I am wondering if I just don't understand basics here. I am clear on runtime groovy VS compile time but still you would think that examples you copy/paste from grails documentation would work if you produced a war file.
java 1.8 Grails 2.5.3 Groovy 2.4.5
[interface java.sql.Connection] [See nested exception: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method groovy.sql.Sql#. Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [interface javax.sql.DataSource] [interface java.sql.Connection]]