JRuby Cassandra 问题

发布于 2024-11-10 18:03:46 字数 1274 浏览 6 评论 0原文

我正在使用 Jruby 连接 Cassandra 和 ruby​​。我正在开发一个必须与 Rails 中的 cassandra 交互的代码。我已经配置并安装了jruby。我还对 cassandra 和 jruby 的所有依赖项进行了“导入”。我在运行文件时遇到问题。我收到这样的错误。

=================================================== ===================================================

org/apache/thrift/transport/TIOStreamTransport.java:132:in `read': org.apache.thrift.transport.TTransportException: null (NativeException)
    from org/apache/thrift/transport/TTransport.java:84:in `readAll'
    from org/apache/thrift/protocol/TBinaryProtocol.java:378:in `readAll'
    from org/apache/thrift/protocol/TBinaryProtocol.java:297:in `readI32'
    from org/apache/thrift/protocol/TBinaryProtocol.java:204:in `readMessageBegin'
    from org/apache/cassandra/thrift/Cassandra.java:1062:in `recv_describe_cluster_name'
    from org/apache/cassandra/thrift/Cassandra.java:1048:in `describe_cluster_name'
    from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
    from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
     ... 13 levels...
    from org/jruby/Main.java:203:in `run'
    from org/jruby/Main.java:100:in `run'
    from org/jruby/Main.java:84:in `main'

​=================================================== ==========

谁能帮我解决这个问题?

I am using Jruby to connect Cassandra and ruby. I am developing a code which had to interact with cassandra from Rails. I have configured and installed jruby. I also did the "import" for all the dependencies for both cassandra and jruby. I am getting issues when running the file. I am getting error like this.

==================================================================================

org/apache/thrift/transport/TIOStreamTransport.java:132:in `read': org.apache.thrift.transport.TTransportException: null (NativeException)
    from org/apache/thrift/transport/TTransport.java:84:in `readAll'
    from org/apache/thrift/protocol/TBinaryProtocol.java:378:in `readAll'
    from org/apache/thrift/protocol/TBinaryProtocol.java:297:in `readI32'
    from org/apache/thrift/protocol/TBinaryProtocol.java:204:in `readMessageBegin'
    from org/apache/cassandra/thrift/Cassandra.java:1062:in `recv_describe_cluster_name'
    from org/apache/cassandra/thrift/Cassandra.java:1048:in `describe_cluster_name'
    from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
    from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
     ... 13 levels...
    from org/jruby/Main.java:203:in `run'
    from org/jruby/Main.java:100:in `run'
    from org/jruby/Main.java:84:in `main'

==============================================================================

Can anyone help me with this issue ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦魇绽荼蘼 2024-11-17 18:03:46

您可以发布您的代码吗?仅通过堆栈跟踪很难进行调试。

看起来您正在使用原始 thrift,有一个用于 java cassandra 客户端库的 jruby 包装器 < href="https://github.com/rantav/hector" rel="nofollow">hector 会更容易使用。

Can you post your code, it is hard to debug from just the stack trace.

It looks like you are using raw thrift, there is a jruby wrapper for the java cassandra client library hector that will be easier to use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文