我正在尝试使用“Putsql”处理器来做到这一点.
我修改流文件使用“ReplaceText”并创建一个INSERT语句.我已经在MySQL数据库中测试了该语句,并且该语句有效.
这是声明:
INSERT INTO monitor.security_nifi (RemoteIPAddress,Timestamp,RequestUrl,Status,Instance)
VALUES ('10.129.2.35','2016-09-2016:44:16,347','/secure/Dashboard.jspa','PASSED','35');
当它通过处理器时,我不断收到此错误:
Failed to process session due to java.lang.IndexOutOfBoundsException:
Index:1,Size:1: java.lang.IndexOutOfBoundsException: Index:1,Size:1
这是堆栈跟踪:
2016-09-21 10:41:24,658 WARN [Timer-Driven Process Thread-1] o.a.n.c.t.ContinuallyRunProcessorTask
java.lang.IndexOutOfBoundsException: Index: 1,Size: 1 at
java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[na:1.8.0_101] at
java.util.ArrayList.get(ArrayList.java:429) ~[na:1.8.0_101] at
org.apache.nifi.processors.standard.Putsql.onTrigger(Putsql.java:304)
~[na:na] at
org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
~[nifi-api-1.0.0.jar:1.0.0] at
org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1064)
~[nifi-framework-core-1.0.0.jar:1.0.0] at
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136)
[nifi-framework-core-1.0.0.jar:1.0.0] at
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
[nifi-framework-core-1.0.0.jar:1.0.0] at
org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
[nifi-framework-core-1.0.0.jar:1.0.0] at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[na:1.8.0_101] at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
[na:1.8.0_101] at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
[na:1.8.0_101] at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
[na:1.8.0_101] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[na:1.8.0_101] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[na:1.8.0_101] at java.lang.Thread.run(Thread.java:745)
[na:1.8.0_101]