Reputation: 163
I'm trying to use the "PutSQL" processor to do exactly that.
I modify the flowfile to using "ReplaceText" and create an INSERT
statement. I have tested that statement in the MySQL database and the statement works.
Here is the statement:
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');
When it goes through the processor, I keep getting this error:
failed to process session due to java.lang.IndexOutOfBoundsException: Index:1, Size:1: java.lang.IndexOutOfBoundsException: Index:1, Size:1
Here is the stack trace:
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]
Upvotes: 7
Views: 1651
Reputation: 12083
This looks like a bug that is hiding an actual issue. Try setting the "Support Fragmented Transactions" property of the PutSQL processor to "false". That should prevent the Index Out Of Bounds Exception, but may also bring to light a real issue that can be corrected. If that's true (that there was another issue and it is corrected), you may be able to restore the property value to "true" and run without error.
Upvotes: 6