[
https://issues.apache.org/jira/browse/NIFI-14435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17942052#comment-17942052
]
David Handermann commented on NIFI-14435:
-----------------------------------------
[~pvillard] Although the changes passed standard unit tests, the system test
workflow uncovered a runtime exception in
{{StandardNiFiServiceFacade.getComponentsAffectedByFlowUpdate()}} which casts
the {{VersionedProcessGroup}} to an {{InstantiatedVersionedComponent}} without
checking the type, causing a {{ClassCastException}}. Creating an empty
{{InstantiatedVersionedProcessGroup}} for the comparison might work, but it
would require providing the identifier values.
Glad to revisit this in a new pull request, but for now I have reverted the
commit and reopened this issue to address further.
Here is the stack trace up to the relevant point:
{noformat}
ERROR [NiFi Web Server-47] o.a.nifi.web.api.config.ThrowableMapper An
unexpected error has occurred: java.lang.ClassCastException: class
org.apache.nifi.flow.VersionedProcessGroup cannot be cast to class
org.apache.nifi.registry.flow.mapping.InstantiatedVersionedComponent
(org.apache.nifi.flow.VersionedProcessGroup is in unnamed module of loader
'app'; org.apache.nifi.registry.flow.mapping.InstantiatedVersionedComponent is
in unnamed module of loader org.apache.nifi.nar.NarClassLoader @28dcca0c).
Returning Internal Server Error response.
java.lang.ClassCastException: class org.apache.nifi.flow.VersionedProcessGroup
cannot be cast to class
org.apache.nifi.registry.flow.mapping.InstantiatedVersionedComponent
(org.apache.nifi.flow.VersionedProcessGroup is in unnamed module of loader
'app'; org.apache.nifi.registry.flow.mapping.InstantiatedVersionedComponent is
in unnamed module of loader org.apache.nifi.nar.NarClassLoader @28dcca0c)
at
org.apache.nifi.web.StandardNiFiServiceFacade.lambda$getComponentsAffectedByFlowUpdate$239(StandardNiFiServiceFacade.java:5787)
at
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at
java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1715)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at
java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at
org.apache.nifi.web.StandardNiFiServiceFacade.getComponentsAffectedByFlowUpdate(StandardNiFiServiceFacade.java:5789)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:359)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at
org.apache.nifi.web.NiFiServiceFacadeLock.proceedWithReadLock(NiFiServiceFacadeLock.java:161)
at
org.apache.nifi.web.NiFiServiceFacadeLock.getLock(NiFiServiceFacadeLock.java:120)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:642)
at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:632)
at
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:727)
at
org.apache.nifi.web.StandardNiFiServiceFacade$$SpringCGLIB$$0.getComponentsAffectedByFlowUpdate(<generated>)
at
org.apache.nifi.web.api.FlowUpdateResource.initiateFlowUpdate(FlowUpdateResource.java:204)
at
org.apache.nifi.web.api.VersionsResource.initiateVersionControlUpdate(VersionsResource.java:1061)
{noformat}
> FlowComparator should offer deep recursive comparison
> -----------------------------------------------------
>
> Key: NIFI-14435
> URL: https://issues.apache.org/jira/browse/NIFI-14435
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Pierre Villard
> Assignee: Pierre Villard
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Consider a versioned process group PG.
> Add a new child process group inside of PG.
> Do many modifications in the child PG (add processors, etc).
> If showing local changes for PG, it'll only say that a process group childPG
> has been added but nothing about what has been done in childPG.
> This JIRA is to add a new Flow Comparator Versioned Strategy in order to
> offer the option for a full exhaustive listing of the differences to also
> include the list of what is being added inside a newly added process group.
> There is no intent with this work to change what is returned to the UI when
> showing local changes as it should be further evaluated in terms of side
> effects.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)