orbisgis / geoclimate

Geospatial processing toolbox for environmental and climate studies
GNU Lesser General Public License v3.0
59 stars 16 forks source link

ERROR : groovy.sql.GroovyResultSetProxy$DummyResultSet.toRowResult() #969

Closed SamuelMarsault closed 5 months ago

SamuelMarsault commented 6 months ago

Hello, I have a program that uses geoclimate and I get this error:

The OSM workflow has been started.
Please wait...
17:25:33.953 [main] INFO GeoClimate -- 1 osm areas will be processed
17:25:34.426 [main] INFO GeoClimate -- Downloading the Nominatim data.
17:25:34.738 [main] INFO GeoClimate -- Extract the OSM data
17:25:37.664 [main] INFO GeoClimate -- Downloading the OSM data from overpass api in C:\Users\Me\AppData\Local\Temp\d4852e681733c7b94b4d3ec11921d1f7e0ee7cca9c8a383.osm
17:25:38.156 [main] INFO GeoClimate -- The OSM file has been downloaded at C:\Users\Me\AppData\Local\Temp\d4852e681733c7b94b4d3ec11921d1f7e0ee7cca9c8a383.osm.
17:25:38.164 [main] INFO GeoClimate -- Load the OSM file in the database.
17:25:38.997 [main] INFO GeoClimate -- The input OSM file has been loaded in the database.
17:25:39.727 [main] INFO GeoClimate -- Building layer created
17:25:39.856 [main] INFO GeoClimate -- Road layer created
17:25:39.876 [main] INFO GeoClimate -- Rail layer created
17:25:40.097 [main] INFO GeoClimate -- Vegetation layer created
17:25:40.157 [main] INFO GeoClimate -- Water layer created
17:25:40.240 [main] INFO GeoClimate -- Impervious layer created
17:25:40.307 [main] INFO GeoClimate -- Urban areas layer created
17:25:40.325 [main] INFO GeoClimate -- Coastline layer created
groovy.lang.MissingMethodException: No signature of method: groovy.sql.GroovyResultSetProxy$DummyResultSet.toRowResult() is applicable for argument types: () values: []
Possible solutions: findResult()
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:72)
        at org.codehaus.groovy.vmplugin.v8.IndyGuardsFiltersAndSignatures.unwrap(IndyGuardsFiltersAndSignatures.java:163)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.orbisgis.geoclimate.osm.InputDataFormatting$_formatBuildingLayer_closure2$_closure14.doCall(InputDataFormatting.groovy:171)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1008)
        at groovy.lang.Closure.call(Closure.java:433)
        at groovy.lang.Closure.call(Closure.java:422)
        at groovy.sql.Sql.eachRow(Sql.java:1262)
        at groovy.sql.Sql.eachRow(Sql.java:1216)
        at groovy.sql.Sql.eachRow(Sql.java:1153)
        at org.orbisgis.data.jdbc.JdbcDataSource.eachRow(JdbcDataSource.java:522)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.orbisgis.geoclimate.osm.InputDataFormatting$_formatBuildingLayer_closure2.doCall(InputDataFormatting.groovy:168)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1008)
        at groovy.lang.Closure.call(Closure.java:433)
        at groovy.lang.Closure.call(Closure.java:422)
        at groovy.sql.Sql.withBatch(Sql.java:3691)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.orbisgis.geoclimate.osm.InputDataFormatting.formatBuildingLayer(InputDataFormatting.groovy:167)
        at org.orbisgis.geoclimate.osm.InputDataFormatting.formatBuildingLayer(InputDataFormatting.groovy)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.orbisgis.geoclimate.osm.WorkflowOSM$_osm_processing_closure2.doCall(WorkflowOSM.groovy:467)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1008)
        at groovy.lang.Closure.call(Closure.java:433)
        at groovy.lang.Closure.call(Closure.java:422)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2389)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2374)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2427)
        at org.codehaus.groovy.runtime.dgm$209.doMethodInvoke(Unknown Source)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.orbisgis.geoclimate.osm.WorkflowOSM.osm_processing(WorkflowOSM.groovy:413)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.orbisgis.geoclimate.osm.WorkflowOSM.workflow(WorkflowOSM.groovy:361)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at org.orbisgis.geoclimate.Geoclimate.call(Geoclimate.groovy:94)
        at org.orbisgis.geoclimate.Geoclimate.call(Geoclimate.groovy)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
        at Import_GeoClimate_Data.runGeoClimate(Import_GeoClimate_Data.groovy:314)
       ...

I use OSM data and the code works normally when I run it in IntelliJ IDEA but as soon as I try to run my program from the command line by doing : java -jar .\project.jar ...

It starts fine, then after the Coastline layer is created, I get this error.

I'm currently using groovy 4.0.17 and java jdk 11.0.2 and maven for find geoclimate dependancies.

I tested with all versions of geoclimate available on sonatype and Maven Repository: 0.0.2-SNAPSHOT, 1.0.0, 1.0.0-SNAPSHOT, 1.0.1-SNAPSHOT and 1.0.2-SNAPSHOT and always the same error.

here is my configuration file :

{
    "description": "Run the Geoclimate chain and export result to a folder",
    "geoclimatedb": {
        "folder": "C:\\Users\\outPut",
        "name": "osm_geoclimate_1716818452707;AUTO_SERVER=TRUE",
        "delete": true
    },
    "input": {
        "locations": [
            "Urbach"
        ],
        "delete": true
    },
    "output": {
        "srid": 2154,
        "folder": {
            "path": "C:\\Users\\outPut",
            "tables": [
                "building",
                "road_traffic",
                "ground_acoustic",
                "rail",
                "zone"
            ]
        }
    },
    "parameters": {
        "rsu_indicators": {
            "indicatorUse": [
                "LCZ"
            ],
            "estimateHeight": true
        },
        "worldpop_indicators": true,
        "road_traffic": true,
        "noise_indicators": {
            "ground_acoustic": true
        }
    }
}

Do you know how I can solve this problem?

ebocher commented 6 months ago

Please pointed us the script and the configuration of the operating environment you are using. Do you have a link ?

SamuelMarsault commented 6 months ago

Please pointed us the script and the configuration of the operating environment you are using. Do you have a link ?

@ebocher you can access my script here : https://github.com/SamuelMarsault/noiseModelling_OSM/blob/dev/src/main/groovy/Import_GeoClimate_Data.groovy

You normally receive an invitation to collaborate.

The OS is windows 10 and "java --version" send me back :

openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

As said before in the project I use groovy 4.0.17

I also tried 2 different ways of launching the program, the first being OSM.workflow(parameters) and the second by using the command line :

 String[] args = ["-w", "OSM", "-f", Paths.get(outputDirectory, "..", "workflow_parameters.json").toString(), "-l", "INFO"]
 def cmd = new CommandLine(new Geoclimate())
 int exitCode = cmd.execute(args)

The only difference between the 2 is that when I run the program from the command line, it shows me the entire execution of the program up to the error shown in the 1st comment, whereas when I run the workflow directly, I just see the name of the error.

Do you need any other information ?

ebocher commented 5 months ago

Sorry but I'm not able to reproduce this issue.

ebocher commented 5 months ago

toRowResult is an internal class of the groovy SQL module and this module is avaible in the dependency grovvy-all.