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数据库发布系统存储的方法有:1.mysql库主从读写分...
使用mysql的方法:在“我的电脑”→右键→“管理”→“服务”...
在mysql中查看root用户权限的方法:1.命令行启动mysql服务;...
MySQL主从复制是用来备份一个与主数据库一样环境的从数据库,...
运行mysql的方法1.启动mysql服务,在“我的电脑”→右键→“...
开启mysql的方法1.可以通过快捷键win+r,输入cmd,打开窗口,...