Support Questions

Find answers, ask questions, and share your expertise

Can't unambiguously select between fixed arity signatures error in nifi 1.16.3

avatar
Master Collaborator

Hello Experts,

 

I am trying to upgrade nifi from 1.12.1 version to 1.16.3.

I have a script 'ECMAScript' which was working fine in 1.12.1and now behaving different in 1.16.3.


Below is the portion of code giving error in 1.16 version when 'xyzId' is null.

But it just logs null as expected in 1.12 version
 

var xyzId = flowFile.getAttribute('xyzId');
log.info(xyzId);

 

Below is the error in 1.16 version when null value received for above line (log.info() line throws below error)

imer-Driven Process Thread-8] o.a.nifi.processors.script.ExecuteScript ExecuteScript[id=bae38131-0181-1000-29af-196312cdd9d9] ExecuteScript[id=bae38131-0181-1000-29af-196312cdd9d9] failed to process due to org.apache.nifi.processor.exception.ProcessException: java.lang.RuntimeException: java.lang.NoSuchMethodException: Can't unambiguously select between fixed arity signatures [(org.apache.nifi.logging.LogMessage), (java.lang.String)] of the method org.apache.nifi.controller.TerminationAwareLogger.info for argument types [null]; rolling back session
org.apache.nifi.processor.exception.ProcessException: java.lang.RuntimeException: java.lang.NoSuchMethodException: Can't unambiguously select between fixed arity signatures [(org.apache.nifi.logging.LogMessage), (java.lang.String)] of the method org.apache.nifi.controller.TerminationAwareLogger.info for argument types [null]
at org.apache.nifi.processors.script.ExecuteScript.onTrigger(ExecuteScript.java:245)
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1283)
at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:214)
at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:103)
at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: Can't unambiguously select between fixed arity signatures [(org.apache.nifi.logging.LogMessage), (java.lang.String)] of the method org.apache.nifi.controller.TerminationAwareLogger.info for argument types [null]
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:397)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at org.apache.nifi.script.impl.JavascriptScriptRunner.run(JavascriptScriptRunner.java:39)
at org.apache.nifi.processors.script.ExecuteScript.onTrigger(ExecuteScript.java:228)
... 11 common frames omitted
Caused by: java.lang.NoSuchMethodException: Can't unambiguously select between fixed arity signatures [(org.apache.nifi.logging.LogMessage), (java.lang.String)] of the method org.apache.nifi.controller.TerminationAwareLogger.info for argument types [null]
at jdk.internal.dynalink.beans.OverloadedMethod.throwAmbiguousMethod(OverloadedMethod.java:225)
at jdk.nashorn.internal.scripts.Script$299$\^eval\_.:program(<eval>:13)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
... 18 common frames omitted


Any idea how to fix this? I want to avoid checking null values for logging also

 

Thanks

Mahendra

1 ACCEPTED SOLUTION

avatar
Super Guru

@hegdemahendra ,

 

This looks like a regression to me. Could you please open a bug Jira on https://issues.apache.org/jira/projects/NIFI/ to report this issue?

 

A workaround for this would be to change your code like below:

log.info(String(xyzId));

 

Cheers

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

2 REPLIES 2

avatar
Super Guru

@hegdemahendra ,

 

This looks like a regression to me. Could you please open a bug Jira on https://issues.apache.org/jira/projects/NIFI/ to report this issue?

 

A workaround for this would be to change your code like below:

log.info(String(xyzId));

 

Cheers

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Master Collaborator