No signature of method boolean/java.lang.Boolean

Hi. I am trying run method org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript() from gradle build script

DriverManager.getConnection(“jdbc:mysql://$project.ext.mysqlAddress”, project.ext.mysqlUser, project.ext.mysqlPassword),
new FileSystemResource(filePath),
false, false,
’#’, ‘;’, ‘/’, '/’

but I have error

No signature of method: static org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript() is applicable for argument types: (com.mysql.jdbc.JDBC4Connection,, java.lang.Boolean, java.lang.Boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
Possible solutions: executeSqlScript(java.sql.Connection,, boolean, boolean, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

What wrong? Thanks.

can you share your buildscript block where you define the dependencies?

    classpath name: 'spring-core', version: '4.2.0.RELEASE', group:'org.springframework'
    classpath name: 'spring-jdbc', version: '4.2.0.RELEASE', group:'org.springframework'

If I use this method with only two first params, that is ok.

The Boolean/boolean thing is misleading, I think. It looks like FileSystemResource isn’t an EncodedResource, so you’re not matching there. Groovy treats everything as an object and would have unboxed for you. I think you need to wrap the FileSystemResource in EncodedResource.

You are right. Thanks!