Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Storm error: java.lang.Long cannot be cast to java.lang.Integer when upgrading from 0.10.0 to 1.0.1

avatar
New Member

I am upgrading from Storm 0.10.0 to 1.0.1 . All is great but when I run it I get the following error.

java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
	at org.apache.storm.eventhubs.spout.EventHubSpout.open(EventHubSpout.java:156) ~[storm-eventhubs-1.0.1.jar:1.0.1]
	at cat.tmatic.mh.spout.TmaticsEventHubSpout.open(TmaticsEventHubSpout.java:71) ~[classes/:?]
	at org.apache.storm.daemon.executor$fn__7885$fn__7900.invoke(executor.clj:601) ~[storm-core-1.0.1.jar:1.0.1]
	at org.apache.storm.util$async_loop$fn__625.invoke(util.clj:482) [storm-core-1.0.1.jar:1.0.1]
	at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_74]
Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
	at org.apache.storm.eventhubs.spout.EventHubSpout.preparePartitions(EventHubSpout.java:124) ~[storm-eventhubs-1.0.1.jar:1.0.1]
	at org.apache.storm.eventhubs.spout.EventHubSpout.open(EventHubSpout.java:153) ~[storm-eventhubs-1.0.1.jar:1.0.1]
	... 5 more

This error references this line in the EventHubSpout.jar:

 stateStore = new ZookeeperStateStore(zkEndpointAddress,
          (Integer)config.get(Config.STORM_ZOOKEEPER_RETRY_TIMES),  <-- right here!
          (Integer)config.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL));

Any love?

1 ACCEPTED SOLUTION

avatar
New Member

This code is in the EventHub jar. I submitted it to Hortonworks and they wrote a JIRA for it. It is an official bug. Not sure how the code ever ran for anyone...

View solution in original post

3 REPLIES 3

avatar
Master Mentor

@mark juchems the property is actually a String, but silly question, did you try casting to long instead of Integer?

(long)config.get(Config.STORM_ZOOKEEPER_RETRY_TIMES)

https://storm.apache.org/releases/1.0.2/javadocs/org/apache/storm/Config.html#STORM_ZOOKEEPER_RETRY_...

avatar
New Member

This code is in the EventHub jar. I submitted it to Hortonworks and they wrote a JIRA for it. It is an official bug. Not sure how the code ever ran for anyone...

avatar
Master Mentor

@mark juchems any chance you can update the thread with JIRA name? Just for a complete picture.