If the method YamlConfigurationLoader.loadConfig() is not able to parse the YAML config file, it throws a ConfigurationException. For example:
org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml: file:/Users/taataar2/workspace/ines-spark-services/ines-spark-apps/target/scala_2.12/cassandra_embedded_db/cu-cassandra-rndport.yaml
Error: Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=java.lang.reflect.InvocationTargetException
in 'reader', line 10, column 1:
cluster_name: 'Test Cluster'
^
This error message is misleading - a user may think, that the YAML config file is malformed. In my case, the real cause was an incompatible version of Guava library in the classpath:
If the method
YamlConfigurationLoader.loadConfig()
is not able to parse the YAML config file, it throws aConfigurationException
. For example:This error message is misleading - a user may think, that the YAML config file is malformed. In my case, the real cause was an incompatible version of Guava library in the classpath:
The problem is, that the
ConfigurationException
misses the cause:Instead the constructor with the
cause
argument should be used. Then we could see the underlying exception, that caused the failure.