Reading-eScience-Centre / edal-java

Environmental Data Abstraction Layer libraries
Other
39 stars 30 forks source link

Problem loading this FMRC dataset #53

Closed rsignell-usgs closed 8 years ago

rsignell-usgs commented 8 years ago

when I try to load this FRMC DAP Data URL into ncWMS2: http://geoport-dev.whoi.edu/thredds/dodsC/coawst_4/use/fmrc/coawst_4_use_best.ncd I get:

Status of dataset COAWST-Forecast (for debugging)

State: ERROR
Loading progress

Starting loading
Using dataset factory: class uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory
Dataset created
Making this dataset available through the WMS catalogue
Error report

Stack trace:
java.lang.NullPointerException
uk.ac.rdg.resc.edal.catalogue.DataCatalogue$1.compare(DataCatalogue.java:247)
uk.ac.rdg.resc.edal.catalogue.DataCatalogue$1.compare(DataCatalogue.java:245)
java.util.TimSort.binarySort(TimSort.java:296)
java.util.TimSort.sort(TimSort.java:221)
java.util.Arrays.sort(Arrays.java:1512)
java.util.ArrayList.sort(ArrayList.java:1454)
java.util.Collections.sort(Collections.java:175)
uk.ac.rdg.resc.edal.catalogue.DataCatalogue.datasetLoaded(DataCatalogue.java:245)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.createDataset(DatasetConfig.java:292)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.refresh(DatasetConfig.java:213)
uk.ac.rdg.resc.edal.catalogue.jaxb.CatalogueConfig$1.run(CatalogueConfig.java:154)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)

I've tried this with two different versions of the TDS.

Can you confirm that this fails in ncWMS2?

If so, how can I figure out why it's failing?

It works okay with the built-in TDS ncWMS: http://geoport-dev.whoi.edu/thredds/godiva2/godiva2.html?server=http://geoport-dev.whoi.edu/thredds/wms/coawst_4/use/fmrc/coawst_4_use_best.ncd# 2016-04-05_14-43-46

guygriffiths commented 8 years ago

This is related to https://github.com/Reading-eScience-Centre/edal-java/issues/52 somehow. The error is occurring in the same place, but I'm unable to reproduce it - it works fine in ncWMS2.

I'll make that code a little more robust, but it'd be interesting to be able to track down the root cause of this.

rsignell-usgs commented 8 years ago

@guygriffiths , I just discovered that stopping ncWMS2 and starting it again makes the problem go away. Does that give you any clues or do you have suggestions what to look for when the problem appears again (which seems likely)? As you say, this is likely the same exact problem I had with #52.

guygriffiths commented 8 years ago

OK, I can reproduce this by setting the Title field to an empty string in the ncWMS2 admin interface. I think that a reload would fix this whilst it may be interpreted as a null upon submission, once saved in the XML it should be an empty string.

I've changed the code so that in that case, the ID is reused for the title of the dataset. Even if that's not the cause it will fail more gracefully and not cause the dataset loading to fail.

I'll try and get a bugfix release out this week.

rsignell-usgs commented 8 years ago

When the problem occurs for me, I can't force load any dataset -- they all give that same error. And they all have titles. Or am I not understanding the problem you discovered?

guygriffiths commented 8 years ago

When I said "reload" I meant restarting ncWMS2 as per your recommendation, rather than forcing a refresh on the dataset.

null titles or null IDs for the dataset are the only likely suspects for causing that NullPointerException - I don't know how they are getting through as null if you've set them, but I think that's the root cause.