Re: setSlotSharing NPE: Starting a stream consumer in a thread
Posted by
Márton Balassi on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/setSlotSharing-NPE-Starting-a-stream-consumer-in-a-thread-tp3021p3023.html
Hi Jay,
Creating a batch and a streaming environment in a single Java source file is fine, they just run separately. (If you run it from an IDE locally they might conflict as the second one would try to launch a local executor on a port that is most likely already taken by the first one.) I would suggest to have these jobs in separate files currently, exactly for the previous reason.
Looking at your code ExecutionEnvironment.getExecutionEnvironment().registerTypeWithKryoSerializer(com.github.rnowling.bps.datagenerator.datamodels.Product.class, new FlinkBPSGenerator.ProductSerializer()); does not do much good for you. You need to register your serializers to the environment to which you are using. Currently you would need to register it to the streaming env variable. If you would like to also assemble a batch job you need to add them there too.
As for the streaming job I assume that you are using Flink version 0.9.1 and checking out the problem shortly.
Best,
Marton