Github user HeartSaVioR commented on the issue:
https://github.com/apache/storm/pull/1751
@vesense
I got an exception while executing topology:
```
21:12:44.247 [main] INFO o.a.s.s.r.DataSourcesRegistry - Registering
scheme kafka with org.apache.storm.sql.kafka.KafkaDataSourcesProvider@338c99c8
Exception in thread "main" java.lang.IllegalStateException: Bolt
'b-0-LOGICALFILTER_6-LOGICALPROJECT_7' contains a non-serializable field of
type org.apache.avro.Schema$RecordSchema, which was instantiated prior to
topology creation. org.apache.avro.Schema$RecordSchema should be instantiated
within the prepare method of 'b-0-LOGICALFILTER_6-LOGICALPROJECT_7 at the
earliest.
at
org.apache.storm.topology.TopologyBuilder.createTopology(TopologyBuilder.java:127)
at
org.apache.storm.trident.topology.TridentTopologyBuilder.buildTopology(TridentTopologyBuilder.java:265)
at
org.apache.storm.trident.TridentTopology.build(TridentTopology.java:529)
at org.apache.storm.sql.StormSqlImpl.submit(StormSqlImpl.java:134)
at org.apache.storm.sql.StormSqlRunner.main(StormSqlRunner.java:63)
Caused by: java.lang.RuntimeException: java.io.NotSerializableException:
org.apache.avro.Schema$RecordSchema
at org.apache.storm.utils.Utils.javaSerialize(Utils.java:235)
at
org.apache.storm.topology.TopologyBuilder.createTopology(TopologyBuilder.java:122)
... 4 more
Caused by: java.io.NotSerializableException:
org.apache.avro.Schema$RecordSchema
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
...
```
Maybe `schema` shouldn't be parsed from constructor. (We could use it for
verification but shouldn't store it.)
Instead, you can initialize for the first time of write() or deserialize(),
and reuse it after calling.
Please let me know if your patch works well with SQL runner with remote
cluster.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---