-
Notifications
You must be signed in to change notification settings - Fork 83
GridDataset.open(path) blows up on Android w/cdm-core:5.3.2, works with netcdf4:4.6.11 #308
Description
I recently posted a question to StackOverflow that was resolved, along with a suggestion that I switch from using netcdf4:4.6.11 to cdm-core:5.3.2 (I'm using it purely to parse GOES-16 data files).
As the immediate result of switching to cdm-core, cleaning, and re-synchronizing Gradle, the call to GridDataset.open(path) is now blowing up (full details at end).
Original Gradle artifact:
implementation('edu.ucar:netcdf4:4.6.11') {
exclude group: 'com.amazonaws', module: 'aws-java-sdk-s3'
}
Present Gradle artifact:
implementation('edu.ucar:cdm-core:5.3.2') {
exclude group: 'com.amazonaws', module: 'aws-java-sdk-s3'
}
The line that used to work, and now blows up:
GridDataset gds = GridDataset.open(file.getAbsolutePath());
The data file itself is being fetched from NOAA's AWS S3 bucket, and saved as an Android temp file with "abi-l2-acmc-" as its prefix, and ".nc" as its suffix.
Example path that used to work, but now blows up:
/data/user/0/pantherkitty.launchspotter/cache/abi-l2-acmc-8973509210811327440.nc
Logcat dump follows at the very end.
I'm taking a stab in the dark, but I know netCDF-Java required an ENORMOUS amount of refactoring to make it usable with Android a couple of years ago. The text of the error message ("exception from call site #31 bootstrap method") makes me wonder whether some chunk of code that's needed by Android might have ended up getting accidentally removed (or, if it's a ground-up rewrite, didn't get put in)?
If it matters, I'm testing it using the x86 Android emulator with API 28 (Android 9)
2020-05-30 23:05:11.638 14719-14719/pantherkitty.launchspotter E/AndroidRuntime: FATAL EXCEPTION: main
Process: pantherkitty.launchspotter, PID: 14719
java.lang.RuntimeException: Caught exception while opening GridDataset
at pantherkitty.launchspotter.CloudMaskData.create(CloudMaskData.java:44)
at pantherkitty.launchspotter.MapsActivity.updateOverlay(MapsActivity.java:127)
at pantherkitty.launchspotter.MapsActivity$2.onReceive(MapsActivity.java:74)
at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.io.IOException: java.lang.BootstrapMethodError: Exception from call site #31 bootstrap method
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:384)
at ucar.nc2.dataset.NetcdfDataset.openProtocolOrFile(NetcdfDataset.java:824)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:478)
at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:633)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:85)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:71)
at pantherkitty.launchspotter.CloudMaskData.create(CloudMaskData.java:41)
at pantherkitty.launchspotter.MapsActivity.updateOverlay(MapsActivity.java:127)
at pantherkitty.launchspotter.MapsActivity$2.onReceive(MapsActivity.java:74)
at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.BootstrapMethodError: Exception from call site #31 bootstrap method
at ucar.nc2.Group.<init>(Group.java:832)
at ucar.nc2.Group.<init>(Group.java:37)
at ucar.nc2.Group$Builder.build(Group.java:1132)
at ucar.nc2.NetcdfFile.makeRootGroup(NetcdfFile.java:2026)
at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:2548)
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:782)
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:381)
at ucar.nc2.dataset.NetcdfDataset.openProtocolOrFile(NetcdfDataset.java:824)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:478)
at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:633)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:85)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:71)
at pantherkitty.launchspotter.CloudMaskData.create(CloudMaskData.java:41)
at pantherkitty.launchspotter.MapsActivity.updateOverlay(MapsActivity.java:127)
at pantherkitty.launchspotter.MapsActivity$2.onReceive(MapsActivity.java:74)
at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassCastException: Bootstrap method returned null
at ucar.nc2.Group.<init>(Group.java:832)
at ucar.nc2.Group.<init>(Group.java:37)
at ucar.nc2.Group$Builder.build(Group.java:1132)
at ucar.nc2.NetcdfFile.makeRootGroup(NetcdfFile.java:2026)
at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:2548)
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:782)
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:381)
at ucar.nc2.dataset.NetcdfDataset.openProtocolOrFile(NetcdfDataset.java:824)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:478)
at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:633)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:85)
at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:71)
at pantherkitty.launchspotter.CloudMaskData.create(CloudMaskData.java:41)
at pantherkitty.launchspotter.MapsActivity.updateOverlay(MapsActivity.java:127)
at pantherkitty.launchspotter.MapsActivity$2.onReceive(MapsActivity.java:74)
at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)