0

I have an application that connects to Cassandra using the Java Driver, fetches some configuration and based on the results generates and executes some PIG scripts.

Now, I am able to successfully connect to Cassandra, when jars required for PIG are not in the classpath. Similarly, I am able to launch PigServer class and execute scripts / statements using the entire DSE stack when I am not connecting to Cassandra using the java driver to retrieve the configuration.

When I use both of them I get following exception:

org.jboss.netty.channel.ChannelPipelineException: Failed to initialize a pipeline.
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:181)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
        ... 35 more
Caused by: org.jboss.netty.channel.ChannelPipelineException: Failed to initialize a pipeline.
        at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:208)
        at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:182)
        at com.datastax.driver.core.Connection.<init>(Connection.java:100)
        at com.datastax.driver.core.Connection.<init>(Connection.java:51)
        at com.datastax.driver.core.Connection$Factory.open(Connection.java:376)
        at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:207)
        at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:170)
        at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:87)
        at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:576)
        at com.datastax.driver.core.Cluster$Manager.access$100(Cluster.java:520)
        at com.datastax.driver.core.Cluster.<init>(Cluster.java:67)
        at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:94)
        at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:501)

I see others have seen similar exception, but when trying to execute Cassandra statements, from MapReduce tasks, which is not my case: https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/FhW_8e4FyAI http://www.datastax.com/dev/blog/the-native-cql-java-driver-goes-ga#comment-297187

Thanks!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Dumitru P.
  • 63
  • 4

2 Answers2

0

DSE stacks connect to Cassandra through thrift API which is different from Cassandra Java Driver.

You can't use Cassandra Java driver for Pig/Hadoop before CASSANDRA-6311 is resolved.

alexLiu
  • 211
  • 2
  • 2
  • I do not use Cassandra Java Driver within Pig / Hadoop Map Reduce Job. I only use it before actually initiating the Hadoop Job. Am I wright when I say thrift and Java Driver cannot be used under the same JVM? – Dumitru P. Dec 04 '13 at 07:44
  • DSE hive classpath has a different versions of netty lib than cassandra, you may need remove it when you add DSE classpath to your application. – alexLiu Dec 04 '13 at 21:55
0

There may be the bad security certificate/security certificate expiration issue if you are using certificate.

Abhale Amol
  • 109
  • 4