我想使用昆德拉框架将一个对象插入cassandra,但收到以下错误:
java.lang.RuntimeException: java.lang.ClassCastException: java.lang.String cannot be cast to [B
at org.apache.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:448) ~[storm-core-1.0.0.jar:1.0.0]
at org.apache.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:414) ~[storm-core-1.0.0.jar:1.0.0]
at org.apache.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:73) ~[storm-core-1.0.0.jar:1.0.0]
at org.apache.storm.daemon.executor$fn__8226$fn__8239$fn__8292.invoke(executor.clj:851) ~[storm-core-1.0.0.jar:1.0.0]
at org.apache.storm.util$async_loop$fn__554.invoke(util.clj:484) [storm-core-1.0.0.jar:1.0.0]
at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
at java.lang.Thread.run(Thread.java:745) [?:1.7.0_99]
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to [B
at org.apache.storm.tuple.TupleImpl.getBinaryByField(TupleImpl.java:185) ~[storm-core-1.0.0.jar:1.0.0]
at connector.bolt.PrinterBolt.execute(PrinterBolt.java:59) ~[Zorro-0.0.1-SNAPSHOT-jar-with-dependencies.jar:?]
at org.apache.storm.daemon.executor$fn__8226$tuple_action_fn__8228.invoke(executor.clj:731) ~[storm-core-1.0.0.jar:1.0.0]
at org.apache.storm.daemon.executor$mk_task_receiver$fn__8147.invoke(executor.clj:463) ~[storm-core-1.0.0.jar:1.0.0]
at org.apache.storm.disruptor$clojure_handler$reify__7663.onEvent(disruptor.clj:40) ~[storm-core-1.0.0.jar:1.0.0]
at org.apache.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:435) ~[storm-core-1.0.0.jar:1.0.0]
... 6 more
我的实体类
@Entity
@Table(name = "pieces", schema = "piece@cassandra_pu")
public class PieceEntitie implements Serializable{
@Id private String IdPiece;
@Column private double width;
@Column private double height;
@Column private double depth;
public PieceEntitie() {
// TODO Auto-generated constructor stub
}
.
.
.
}
我遵循了教程:https://github.com/impetus-opensource/kundera/wiki/getting-started-in-5-minutes
你知道这个问题的根源吗?我们怎样才能解决它?谢谢您
1条答案
按热度按时间ia2d9nvy1#
风暴法应用中的问题
TupleImpl.getBinaryByField()
它说,它不能byte[]
从String
. storm元组中有一些字符串值,您正在尝试获取字节数组。