From be1969a3d5358ddd3623fa6774d59a45a02cdbe1 Mon Sep 17 00:00:00 2001 From: fsgonz Date: Mon, 2 Dec 2024 17:00:55 -0300 Subject: [PATCH] W-16491237: NullPointer Exception when using the extension client inside another extension operation --- .../execution/MethodArgumentResolverDelegate.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/extensions-support/src/main/java/org/mule/runtime/module/extension/internal/runtime/execution/MethodArgumentResolverDelegate.java b/modules/extensions-support/src/main/java/org/mule/runtime/module/extension/internal/runtime/execution/MethodArgumentResolverDelegate.java index 7e3924b36ce9..fbfd72eff227 100644 --- a/modules/extensions-support/src/main/java/org/mule/runtime/module/extension/internal/runtime/execution/MethodArgumentResolverDelegate.java +++ b/modules/extensions-support/src/main/java/org/mule/runtime/module/extension/internal/runtime/execution/MethodArgumentResolverDelegate.java @@ -6,9 +6,8 @@ */ package org.mule.runtime.module.extension.internal.runtime.execution; -import static java.lang.System.arraycopy; -import static org.apache.commons.lang3.ArrayUtils.isEmpty; import static org.mule.runtime.api.util.collection.Collectors.toImmutableMap; +import static org.mule.runtime.core.api.lifecycle.LifecycleUtils.initialiseIfNeeded; import static org.mule.runtime.module.extension.internal.loader.parser.java.MuleExtensionAnnotationParser.getParamNames; import static org.mule.runtime.module.extension.internal.loader.parser.java.MuleExtensionAnnotationParser.toMap; import static org.mule.runtime.module.extension.internal.runtime.execution.MethodArgumentResolverUtils.isConfigParameter; @@ -25,6 +24,10 @@ import static org.mule.runtime.module.extension.internal.util.ParameterGroupUtils.hasParameterGroupAnnotation; import static org.mule.runtime.module.extension.internal.util.ParameterGroupUtils.isParameterGroupShowInDsl; +import static java.lang.System.arraycopy; + +import static org.apache.commons.lang3.ArrayUtils.isEmpty; + import org.mule.metadata.java.api.JavaTypeLoader; import org.mule.runtime.api.component.location.ComponentLocation; import org.mule.runtime.api.lifecycle.Initialisable; @@ -404,6 +407,9 @@ private Map> getPara @Override public void initialise() throws InitialisationException { + // The dependencies for this bean are injected through the lifecycle utils. It is also initialized through it. + // That's why we have to initialized the extension client if needed, as the extension client is not singleton. + initialiseIfNeeded(extensionsClient); initArgumentResolvers(); }