Application fails to start: No setter found for property: index-prefix
njmarques opened this issue · 2 comments
Starting application with java -Xms2g -Xmx4g -jar target/snowstorm*.jar --spring.config.additional-location=application-local.properties --delete-indices --import=/data/SNOMED/SnomedCT_InternationalRF2_PRODUCTION_20220731T120000Z.zip or java -Xms2g -Xmx4g -jar target/snowstorm*.jar --delete-indices --import=/data/SNOMED/SnomedCT_InternationalRF2_PRODUCTION_20220731T120000Z.zip results in the error below.
application-local.properties is a copy of application.properties with
elasticsearch.index.prefix=local_
elasticsearch.index-prefix=local_
An environment variable is also set.
$echo $ELASTICSEARCH_INDEX_PREFIX
local_
Error Message
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'elasticsearch' to org.snomed.snowstorm.config.ElasticsearchProperties:
Property: elasticsearch.index-prefix
Value: "local_"
Origin: System Environment Property "ELASTICSEARCH_INDEX_PREFIX"
Reason: java.lang.IllegalStateException: No setter found for property: index-prefix
Action:
Update your application's configuration
OS: Ubuntu 20.04.6
Java JDK: openjdk version "17.0.9" 2023-10-17.
Elasticsearch: docker.elastic.co/elasticsearch/elasticsearch:8.11.1
Snowstorm: 10.1.0
I feel like I'm missing something from the start up but I'm not able find it.
Thank you
@njmarques Snowstorm expects elasticsearch.index.prefix parameter not elasticsearch.index-prefix. Can you make sure you have elasticsearch.index.prefix parameter configured in the application-local.properties? Hope this will fix your issue. Thanks.
Both properties for are in the properties file so the application will pick up which ever one is valid. The issue was with the environment variable. The error went away when it was removed.