Open pmauduit opened 6 years ago
If the error message "Parameters saved but cannot restart Lucene Index Optimizer: null" is thrown from here https://github.com/geonetwork/core-geonetwork/blob/cc04086527c8b47de54cfa332aab94240e9788ba/services/src/main/java/org/fao/geonet/api/site/SiteApi.java#L137 it calls this piece of code, where these attributes are initialized: https://github.com/geonetwork/core-geonetwork/blob/cc04086527c8b47de54cfa332aab94240e9788ba/core/src/main/java/org/fao/geonet/kernel/search/LuceneOptimizerManager.java#L110-L111
it calls this piece of code, where these attributes are initialized:
This code is not reached, because of the NPE thrown at line 106 (_beginAt
being null)
Right! So better make this code more robust.
Considering the following code: https://github.com/geonetwork/core-geonetwork/blob/develop/core/src/main/java/org/fao/geonet/kernel/search/LuceneOptimizerManager.java#L70-L74
If the first state of the optimizer is
enabled
set tofalse
, the_beginAt
member variable would never be initialized, causing any change in the admin UI (activating / deactivating the index optimizer) to fail with the following message:Following the generated stacktrace lead me here:
I guess the correct behaviour would be, regardless of the
enabled
value, to set the_beginAt
variable in the constructor (even if the bean is actually deactivated).