Reading-eScience-Centre / ncwms

ncWMS - A Web Map Service for displaying environmental data over the web
Other
62 stars 30 forks source link

Problem when using Dynamic Services () #80

Open nuds-zhao opened 3 years ago

nuds-zhao commented 3 years ago

Hi, I deployed a developer version of the ncWMS server to solve the problem in Problem when using Dynamic Services #76. But one day all layers using Dynamic Services are failed to load, with the error of "The layer *** was not found on this server". I wonder if there is any problem with this version of ncWMS.

Btw, as I observed in the past month, the problem in Issue #76 is still there, although it's less frequent to appear.

nuds-zhao commented 3 years ago

I find the reason why all layers can't be loaded. I accidentally leave one empty Alias in the server: empty_alias

It's quite difficult to identify this empty one from the default blank one. Hence I suggest that adding a condition before we match Alias with LayerName to prevent this situation in the NcwmsCatalogue.java: before after

guygriffiths commented 3 years ago

I'm not sure I follow. layerName.startsWith(null) will always return false - so explicitly testing that testDynamicService.getAlias() != null will never make a difference to that condition.

nuds-zhao commented 3 years ago

Yeah, you are right. I made a mistake here. The empty Alias should correspond to an empty string. null may represent the default condition, so it would not make any difference. How about layerName.startsWith('')? What would that return? I think the correct condition to test should betestDynamicService.getAlias() != ''.