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

    Cannot authenticate on Apache Cassandra 2.2.x

    Stack Overflow | 1 year ago | Renato Perini
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in com.objectway.dwx.datatest.config.CassandraConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminOperations]: Factory method 'cassandraTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'session' defined in com.objectway.dwx.datatest.config.CassandraConfiguration: Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host /127.0.0.1:9042: Host /127.0.0.1:9042 requires authentication, but no authenticator found in Cluster configuration
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Not able to change Authentication in spark-cassandra-connector

    Stack Overflow | 9 months ago | Kaushal
    java.io.IOException: Failed to open native connection to Cassandra at {192.168.1.17}:9042
  6. 0

    I am creating one Spark-Cassandra App (Spark 1.6.0 & spark-cassandra-connector 1.6.0-M1), in which i am asking multiple users to enter their Cassandra properties like Host, Username, Password, Keyspace, Table and others. To change the above properties dynamically and create dataframe from Cassandra table, I Googled and found out some information http://www.russellspitzer.com/2016/02/16/Multiple-Clusters-SparkSql-Cassandra/ https://github.com/datastax/spark-cassandra-connector/blob/master/doc/14_data_frames.md#setting-cluster-and-keyspace-level-options {code:java} val csc = new CassandraSQLContext(SparkConnection._sc) csc.setConf(s"${cluster}/spark.cassandra.connection.host", host) csc.setConf(s"${cluster}/spark.cassandra.connection.port", port) csc.setConf(s"${cluster}/spark.cassandra.auth.username", username) csc.setConf(s"${cluster}/spark.cassandra.auth.password", password) csc.read.format("org.apache.spark.sql.cassandra") .options(Map("cluster" -> cluster, "keyspace" -> keySpace, "table" -> table)) .load() {code} I tried with mention properties, Clusters those doesn't require authentication is connecting successfully but when i try to connect with secure cluster using username & password properties, i am getting some error. {code:java} Exception in thread "Thread-10" java.io.IOException: Failed to open native connection to Cassandra at {192.168.1.17}:9042 at com.datastax.spark.connector.cql.CassandraConnector$.com$datastax$spark$connector$cql$CassandraConnector$$createSession(CassandraConnector.scala:162) at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$2.apply(CassandraConnector.scala:148) at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$2.apply(CassandraConnector.scala:148) at com.datastax.spark.connector.cql.RefCountedCache.createNewValueAndKeys(RefCountedCache.scala:31) at com.datastax.spark.connector.cql.RefCountedCache.acquire(RefCountedCache.scala:56) at com.datastax.spark.connector.cql.CassandraConnector.openSession(CassandraConnector.scala:81) at com.datastax.spark.connector.cql.CassandraConnector.withSessionDo(CassandraConnector.scala:109) at com.datastax.spark.connector.rdd.partitioner.CassandraRDDPartitioner$.getTokenFactory(CassandraRDDPartitioner.scala:184) at org.apache.spark.sql.cassandra.CassandraSourceRelation$.apply(CassandraSourceRelation.scala:267) at org.apache.spark.sql.cassandra.DefaultSource.createRelation(DefaultSource.scala:57) at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119) at com.bdbizviz.pa.spark.util.ServiceUtil$.readData(ServiceUtil.scala:97) at com.bdbizviz.pa.spark.services.SparkServices$$anon$1.run(SparkServices.scala:114) at java.lang.Thread.run(Thread.java:745) Caused by: com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host /192.168.1.17:9042: Host /192.168.1.17:9042 requires authentication, but no authenticator found in Cluster configuration at com.datastax.driver.core.AuthProvider$1.newAuthenticator(AuthProvider.java:40) at com.datastax.driver.core.Connection$5.apply(Connection.java:250) at com.datastax.driver.core.Connection$5.apply(Connection.java:234) at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:861) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185) at com.datastax.driver.core.Connection$Future.onSet(Connection.java:1174) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1005) at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:928) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:831) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:346) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111) ... 1 more {code}

    DataStax JIRA | 8 months ago | Kaushal Prajapati
    java.io.IOException: Failed to open native connection to Cassandra at {192.168.1.17}:9042

    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.AuthenticationException

      Authentication error on host /172.16.3.32:9042: Host /172.16.3.32:9042 requires authentication, but no authenticator found in Cluster configuration

      at com.datastax.driver.core.AuthProvider$1.newAuthenticator()
    2. DataStax Java Driver for Apache Cassandra - Core
      Connection$5.apply
      1. com.datastax.driver.core.AuthProvider$1.newAuthenticator(AuthProvider.java:38)
      2. com.datastax.driver.core.Connection$5.apply(Connection.java:251)
      3. com.datastax.driver.core.Connection$5.apply(Connection.java:238)
      3 frames
    3. Guava
      AbstractFuture.set
      1. com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:863)
      2. com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
      3. com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
      4. com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
      5. com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
      5 frames
    4. DataStax Java Driver for Apache Cassandra - Core
      Connection$Dispatcher.channelRead0
      1. com.datastax.driver.core.Connection$Future.onSet(Connection.java:1170)
      2. com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1000)
      3. com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:922)
      3 frames
    5. Netty
      SingleThreadEventExecutor$2.run
      1. io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
      2. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      3. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      4. io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
      5. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      6. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      7. io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
      8. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      9. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      10. io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
      11. io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      12. io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      13. io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
      14. io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
      15. io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
      16. io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
      17. io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
      18. io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
      19. io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
      19 frames
    6. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame