Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

Error NoHostAvailableException thrown  #4

Description

@balajikadambi

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Set up configuration.properties with all the details
Executed the command - java -cp target/cosmosdb-cassandra-examples.jar com.azure.cosmosdb.cassandra.examples.UserProfile

Any log messages given by the failure

com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: indb.cassandra.cosmos.azure.com/40.112.241.48:10350 (com.datastax.driver.core.exceptions.TransportException: [indb.cassandra.cosmos.azure.com/40.112.241.48:10350] Error writing))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:232)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
at com.datastax.driver.core.Cluster$Manager.negotiateProtocolVersionAndConnect(Cluster.java:1600)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1518)
at com.datastax.driver.core.Cluster.init(Cluster.java:159)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:330)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:305)
at com.datastax.driver.core.Cluster.connect(Cluster.java:247)
at com.azure.cosmosdb.cassandra.util.CassandraUtils.getSession(CassandraUtils.java:64)
at com.azure.cosmosdb.cassandra.examples.UserProfile.main(UserProfile.java:26)
Please delete your table after verifying the presence of the data in portal or from CQL
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.datastax.driver.core.Session.execute(String)" because "this.session" is null
at com.azure.cosmosdb.cassandra.repository.UserRepository.createKeyspace(UserRepository.java:29)
at com.azure.cosmosdb.cassandra.examples.UserProfile.main(UserProfile.java:32)

Expected/desired behavior

The program should have executed without errors.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
MacOS

Versions

13.4

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions