java – Nifi“PutSQL”超出范围的例外

前端之家收集整理的这篇文章主要介绍了java – Nifi“PutSQL”超出范围的例外前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在尝试使用“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]

最佳答案
这看起来像是隐藏实际问题的错误.尝试将Putsql处理器的“支持分段事务”属性设置为“false”.这应该可以防止Index Out of Bounds Exception,但也可以揭示一个可以纠正的真正问题.如果这是真的(存在另一个问题并且已得到纠正),您可以将属性值恢复为“true”并运行而不会出现错误.

猜你在找的MySQL相关文章