2017-05-04 47 views
0

我用融合的卡夫卡連接-JDBC源卡夫卡與我的mysql數據庫連接和我遇到了下面這個錯誤:匯合卡夫卡連接-JDBC顯示java.lang.NullPointerException

java.lang.NullPointerException 
    at io.confluent.connect.jdbc.source.TimestampIncrementingTableQuerier.extractOffset(TimestampIncrementingTableQuerier.java:218) 
    at io.confluent.connect.jdbc.source.TimestampIncrementingTableQuerier.extractRecord(TimestampIncrementingTableQuerier.java:185) 
    at io.confluent.connect.jdbc.source.JdbcSourceTask.poll(JdbcSourceTask.java:195) 
    at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:155) 
    at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:140) 
    at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:175) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 

回答

0

對於我來說,這個錯誤是由查詢造成的。我用遞增模式查詢「select ... from table」,但是我的sql沒有選擇遞增列。我不關心更新時間,這是我的遞增列名,但我必須將其添加到SQL查詢中,如「select updatetime,... from table」