flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From madan <madan.yella...@gmail.com>
Subject NPE when using spring bean in custom input format
Date Wed, 16 Jan 2019 09:20:44 GMT

Need help in the below scenario,

I have CustomInputFormat which loads the records using a bean,

public class CustomInputFormat extends GenericInputFormat {

      private Iterator<Map<String, Object>> recordsIterator;


        public void open(GenericInputSplit split) throws IOException {

               ServiceX serviceX = SpringBeanFinder.getBean(ServiceX.class);

                recordsIterator = serviceX.getRecords(..);



The above input format works fine when using Flink LocalEnvironment in
spring application. Problem is when running flink in a cluster mode and
trying to connect to it using RemoveEnvironment. Since Spring applicaiton
context will not be initialized, NPE is thrown. Please suggest what could
be the solution in this scenario.

Thank you,

View raw message