java.lang.reflect.InvocationTargetException

The OpenNMS Issue Tracker | Alejandro Galue | 12 months ago
  1. 0

    When running "newts init" after properly configure org.opennms.newts.config.hostname on opennms.properties, the tool ignore that setting and assume that cassandra is running on the same machine (i.e. localhost): {code} [root@onms17srv bin]# ./newts init Initializing the 'newts' keyspaces on localhost:9042 21:46:12.193 [Main] INFO com.datastax.driver.core.NettyUtil - Did not find Netty's native epoll transport in the classpath, defaulting to NIO. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.opennms.bootstrap.Bootstrap$3.run(Bootstrap.java:373) at java.lang.Thread.run(Thread.java:745) Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1272) at com.datastax.driver.core.Cluster.init(Cluster.java:158) at com.datastax.driver.core.Cluster.connect(Cluster.java:248) at org.opennms.newts.cassandra.SchemaManager.<init>(SchemaManager.java:47) at org.opennms.netmgt.newts.cli.Init.execute(Init.java:47) at org.opennms.netmgt.newts.cli.Newts.main(Newts.java:56) ... 6 more [root@onms17srv bin]# grep "newts.*hostname" /opt/opennms/etc/opennms.properties org.opennms.newts.config.hostname=cassandrasrv01 {code} Current workaround is to edit the script and force the settings, for example: {code} exec "$OPENNMS_BINDIR"/runjava -r -- $JAVA_OPTIONS \ -Dorg.opennms.newts.config.hostname=cassandrasrv01 \ -Dopennms.home="$OPENNMS_HOME" \ -Dlog4j.configurationFile="$OPENNMS_HOME"/etc/log4j2-tools.xml \ -Dopennms.manager.class="$APP_CLASS" \ -jar "$OPENNMS_HOME"/lib/opennms_bootstrap.jar \ "$@" {code}

    The OpenNMS Issue Tracker | 12 months ago | Alejandro Galue
    java.lang.reflect.InvocationTargetException
  2. 0

    When running "newts init" after properly configure org.opennms.newts.config.hostname on opennms.properties, the tool ignore that setting and assume that cassandra is running on the same machine (i.e. localhost): {code} [root@onms17srv bin]# ./newts init Initializing the 'newts' keyspaces on localhost:9042 21:46:12.193 [Main] INFO com.datastax.driver.core.NettyUtil - Did not find Netty's native epoll transport in the classpath, defaulting to NIO. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.opennms.bootstrap.Bootstrap$3.run(Bootstrap.java:373) at java.lang.Thread.run(Thread.java:745) Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1272) at com.datastax.driver.core.Cluster.init(Cluster.java:158) at com.datastax.driver.core.Cluster.connect(Cluster.java:248) at org.opennms.newts.cassandra.SchemaManager.<init>(SchemaManager.java:47) at org.opennms.netmgt.newts.cli.Init.execute(Init.java:47) at org.opennms.netmgt.newts.cli.Newts.main(Newts.java:56) ... 6 more [root@onms17srv bin]# grep "newts.*hostname" /opt/opennms/etc/opennms.properties org.opennms.newts.config.hostname=cassandrasrv01 {code} Current workaround is to edit the script and force the settings, for example: {code} exec "$OPENNMS_BINDIR"/runjava -r -- $JAVA_OPTIONS \ -Dorg.opennms.newts.config.hostname=cassandrasrv01 \ -Dopennms.home="$OPENNMS_HOME" \ -Dlog4j.configurationFile="$OPENNMS_HOME"/etc/log4j2-tools.xml \ -Dopennms.manager.class="$APP_CLASS" \ -jar "$OPENNMS_HOME"/lib/opennms_bootstrap.jar \ "$@" {code}

    The OpenNMS Issue Tracker | 12 months ago | Alejandro Galue
    java.lang.reflect.InvocationTargetException
  3. 0

    Cassandra 2.1, Datastax Java driver 2.1.1 - Custom authentication/authorization plugin causes NoHostAvailableException

    Stack Overflow | 2 years ago | Al A
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Cannot connect))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    phantom-testkit: Not able to deploy auto embedded cassandra

    GitHub | 1 year ago | rohitgupta-90
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Cannot connect))
  6. 0

    Cassandra 2.1, Datastax Java driver 2.1.1 - Custom authentication/authorization plugin causes NoHostAvailableException

    codedmi.com | 1 year ago
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Cannot connect))
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. com.datastax.driver.core.exceptions.NoHostAvailableException

    All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] Cannot connect))

    at com.datastax.driver.core.ControlConnection.reconnectInternal()
  2. DataStax Java Driver for Apache Cassandra - Core
    Cluster.connect
    1. com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223)
    2. com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78)
    3. com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1272)
    4. com.datastax.driver.core.Cluster.init(Cluster.java:158)
    5. com.datastax.driver.core.Cluster.connect(Cluster.java:248)
    5 frames
  3. New Timeseries Datastore :: Cassandra :: Common
    SchemaManager.<init>
    1. org.opennms.newts.cassandra.SchemaManager.<init>(SchemaManager.java:47)
    1 frame
  4. org.opennms.netmgt
    Newts.main
    1. org.opennms.netmgt.newts.cli.Init.execute(Init.java:47)
    2. org.opennms.netmgt.newts.cli.Newts.main(Newts.java:56)
    2 frames
  5. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  6. org.opennms.bootstrap
    Bootstrap$3.run
    1. org.opennms.bootstrap.Bootstrap$3.run(Bootstrap.java:373)
    1 frame
  7. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame