java.lang.IllegalArgumentException: Null or empty data center specified for DC-aware policy

DataStax JIRA | Andy Tolbert | 2 years ago
  1. 0

    From the changes in [JAVA-451], it is now no longer possible from the outside to specify a 'null' localDC when creating a DCAwareRoundRobinPolicy and have it figured out the localDC based on contact points, however the [documentation states|http://docs.datastax.com/en/drivers/java/2.1/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html#DCAwareRoundRobinPolicy(java.lang.String)] that this functionality still works: {quote} localDc - the name of the local datacenter (as known by Cassandra). If this is null, the policy will default to the data-center of the first node connected to. {quote} Passing in a null localDC parameter emits the following error: {noformat} Exception in thread "main" java.lang.IllegalArgumentException: Null or empty data center specified for DC-aware policy at com.datastax.driver.core.policies.DCAwareRoundRobinPolicy.<init>(DCAwareRoundRobinPolicy.java:176) at com.datastax.driver.core.policies.DCAwareRoundRobinPolicy.<init>(DCAwareRoundRobinPolicy.java:138) {noformat} with the following code: {code} Cluster cluster = new Cluster.Builder() .withLoadBalancingPolicy(new DCAwareRoundRobinPolicy(null, 2)) .addContactPoint("127.0.0.1") .build(); {code} Additionally, A user could use the default Constructor for DCAwareRoundRobinPolicy to use the DC the contact points are in, but if they want to control the usedRemoteHostsPerDc / allowRemoteDCsForLocalConsistencyLevel options, they cannot. It seems like we should be able to support this, ([JAVA-652] will take care of this).

    DataStax JIRA | 2 years ago | Andy Tolbert
    java.lang.IllegalArgumentException: Null or empty data center specified for DC-aware policy
  2. 0

    From the changes in [JAVA-451], it is now no longer possible from the outside to specify a 'null' localDC when creating a DCAwareRoundRobinPolicy and have it figured out the localDC based on contact points, however the [documentation states|http://docs.datastax.com/en/drivers/java/2.1/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html#DCAwareRoundRobinPolicy(java.lang.String)] that this functionality still works: {quote} localDc - the name of the local datacenter (as known by Cassandra). If this is null, the policy will default to the data-center of the first node connected to. {quote} Passing in a null localDC parameter emits the following error: {noformat} Exception in thread "main" java.lang.IllegalArgumentException: Null or empty data center specified for DC-aware policy at com.datastax.driver.core.policies.DCAwareRoundRobinPolicy.<init>(DCAwareRoundRobinPolicy.java:176) at com.datastax.driver.core.policies.DCAwareRoundRobinPolicy.<init>(DCAwareRoundRobinPolicy.java:138) {noformat} with the following code: {code} Cluster cluster = new Cluster.Builder() .withLoadBalancingPolicy(new DCAwareRoundRobinPolicy(null, 2)) .addContactPoint("127.0.0.1") .build(); {code} Additionally, A user could use the default Constructor for DCAwareRoundRobinPolicy to use the DC the contact points are in, but if they want to control the usedRemoteHostsPerDc / allowRemoteDCsForLocalConsistencyLevel options, they cannot. It seems like we should be able to support this, ([JAVA-652] will take care of this).

    DataStax JIRA | 2 years ago | Andy Tolbert
    java.lang.IllegalArgumentException: Null or empty data center specified for DC-aware policy
  3. 0
    This error is caused by malformed HTTP request. You are trying to access unsecured page through https.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Null or empty data center specified for DC-aware policy

      at com.datastax.driver.core.policies.DCAwareRoundRobinPolicy.<init>()
    2. DataStax Java Driver for Apache Cassandra - Core
      DCAwareRoundRobinPolicy.<init>
      1. com.datastax.driver.core.policies.DCAwareRoundRobinPolicy.<init>(DCAwareRoundRobinPolicy.java:176)
      2. com.datastax.driver.core.policies.DCAwareRoundRobinPolicy.<init>(DCAwareRoundRobinPolicy.java:138)
      2 frames