0
votes

I want to insert an object into cassandra using kundera framework, but i receive this error:

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

my entity class

@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
    }
.
.
.
}

I followed the tutorial : https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes

have you any idea about the source of this problem, and how we can resolve it? thank you

1
This is not the class, you should look - Abimaran Kugathasan
I don't understand what do you mean by this is not the class. Im trying to save the object PieceEntitie into cassandra, but I receive this error - h.zak

1 Answers

0
votes

Problem in using Storm method TupleImpl.getBinaryByField() it throws exception wich says, that it can't get byte[] from String. Storm tuple have some string value inside and you are trying to get byte array instead.