I have a problem when build Mule application outside anypoint studio using mvn clean test in command prompt
when i execute the command I got the error:
Message : Error creating bean with name 'process-logic-service-flow': Cannot create inner bean '(inner bean)#62fd718' of type [com.mulesoft.mule.runtime.core.internal.processor.DynamicEvaluateProcessor] while setting bean property 'messageProcessors' with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#62fd718': Cannot create inner bean '(inner bean)#5466c7bf' of type [com.mulesoft.mule.runtime.core.internal.processor.DynamicEvaluateProcessorParameters] while setting bean property 'parameters'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#5466c7bf': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'annotations' of bean class [com.mulesoft.mule.runtime.core.internal.processor.DynamicEvaluateProcessorParameters]: Bean property 'annotations' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Element : process-order-api-Flow/processors/2/route/1/processors/0/route/1/processors/2 @ m4-logic-services:flows/process/process-order-api.xml:168 (Calling Process logic Service Flow)
Element DSL : <flow-ref doc:name="Calling Process logic Service Flow" doc:id="90c6a060-8db7-4120-b0be-00c37e576b96" name="process-logic-service-flow"></flow-ref>
Error type : MULE:UNKNOWN
FlowStack : at process-order-api-Flow(process-order-api-Flow/processors/2/route/1/processors/0/route/1/processors/2 @ m4-logic-services:flows/process/process-order-api.xml:168 (Calling Process logic Service Flow))
at post:\order\searchFilter:application\json:logics-api-config(post:\order\searchFilter:application\json:logics-api-config/processors/1 @ m4-logic-services:flows/experience/experience-logic-services-api.xml:134 (Call process-order-api-Flow))
--------------------------------------------------------------------------------
Root Exception stack trace:
org.springframework.beans.NotWritablePropertyException: Invalid property 'annotations' of bean class [com.mulesoft.mule.runtime.core.internal.processor.DynamicEvaluateProcessorParameters]: Bean property 'annotations' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243)
at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:426)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:97)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:77)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1714)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:312)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:131)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:312)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:131)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:401)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:338)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.mule.runtime.config.internal.ObjectProviderAwareBeanFactory.getBean(ObjectProviderAwareBeanFactory.java:78)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean.getReferencedProcessor(FlowRefFactoryBean.java:231)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean.getReferencedFlow(FlowRefFactoryBean.java:161)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean$$EnhancerByCGLIB$$1a3b6258.CGLIB$getReferencedFlow$2(<generated>)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean$$EnhancerByCGLIB$$1a3b6258$$FastClassByCGLIB$$7e361ccb.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.mule.runtime.config.internal.dsl.spring.ObjectFactoryClassRepository.lambda$getObjectFactoryDynamicClass$1(ObjectFactoryClassRepository.java:125)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean$$EnhancerByCGLIB$$1a3b6258.getReferencedFlow(<generated>)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean$StaticFlowRefMessageProcessor.lambda$new$0(FlowRefFactoryBean.java:297)
at org.mule.runtime.api.util.LazyValue.get(LazyValue.java:75)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean$StaticFlowRefMessageProcessor.apply(FlowRefFactoryBean.java:317)
at org.mule.runtime.config.internal.factories.FlowRefFactoryBean$StaticFlowRefMessageProcessor.apply(FlowRefFactoryBean.java:291)
at java.util.function.Function.lambda$andThen$1(Function.java:88)
at java.util.function.Function.lambda$andThen$1(Function.java:88)
at reactor.core.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.privileged.processor.chain.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at reactor.core.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.internal.processor.chain.* (2 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at reactor.core.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.internal.processor.strategy.reactor.builder.ReactorPublisherBuilder$FluxBuilder.transform(ReactorPublisherBuilder.java:182)
at org.mule.runtime.core.internal.processor.strategy.reactor.builder.ComponentProcessingStrategyReactiveProcessorBuilder.baseProcessingStrategyPublisherBuilder(ComponentProcessingStrategyReactiveProcessorBuilder.java:148)
at org.mule.runtime.core.internal.processor.strategy.reactor.builder.ComponentProcessingStrategyReactiveProcessorBuilder.lambda$build$0(ComponentProcessingStrategyReactiveProcessorBuilder.java:118)
at reactor.core.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.internal.processor.strategy.TransactionAwareStreamEmitterProcessingStrategyDecorator.lambda$null$6(TransactionAwareStreamEmitterProcessingStrategyDecorator.java:152)
at reactor.core.* (14 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.internal.processor.interceptor.ReactiveInterceptionAction.proceed(ReactiveInterceptionAction.java:75)
at org.mule.munit.mock.interception.MunitProcessorInterceptor.around(MunitProcessorInterceptor.java:129)
at org.mule.runtime.core.internal.processor.interceptor.ProcessorInterceptorWrapper.around(ProcessorInterceptorWrapper.java:68)
at org.mule.runtime.core.internal.processor.interceptor.ReactiveAroundInterceptorAdapter.lambda$doAround$3(ReactiveAroundInterceptorAdapter.java:95)
at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:224)
at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:1075)
at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:993)
at org.mule.runtime.core.internal.processor.interceptor.ReactiveAroundInterceptorAdapter.doAround(ReactiveAroundInterceptorAdapter.java:94)
at org.mule.runtime.core.internal.processor.interceptor.ReactiveAroundInterceptorAdapter.lambda$null$0(ReactiveAroundInterceptorAdapter.java:72)
at reactor.core.* (95 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at reactor.core.* (9 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.privileged.processor.chain.* (2 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at reactor.core.* (13 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.internal.rx.FluxSinkRecorder$DirectDelegate.next(FluxSinkRecorder.java:196)
at org.mule.runtime.core.internal.rx.FluxSinkRecorder.next(FluxSinkRecorder.java:68)
at org.mule.runtime.core.privileged.processor.chain.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at reactor.core.* (30 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
at java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:778)
at java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2140)
at java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:110)
at reactor.core.* (98 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
at reactor.core.* (12 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.privileged.processor.chain.* (2 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at reactor.core.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at org.mule.runtime.core.privileged.processor.chain.* (2 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at reactor.core.* (6 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:113)
at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:54)
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: com.mulesoft.mule.runtime.core.internal.processor.DynamicEvaluateProcessor: MUnit Tests Failed
**
but the MUnit test suites runs fine inside anypoint studio.
my pom file plugins and dependency:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<sharedLibraries>
<sharedLibrary>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</sharedLibrary>
<sharedLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</sharedLibrary>
<sharedLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</sharedLibrary>
<sharedLibrary>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</sharedLibrary>
<sharedLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</sharedLibrary>
</sharedLibraries>
</configuration>
</plugin>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<version>${munit.version}</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
<goal>coverage-report</goal>
</goals>
</execution>
</executions>
<configuration>
<coverage>
<runCoverage>true</runCoverage>
<formats>
<format>html</format>
</formats>
</coverage>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<version>${munit.version}</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
<goal>coverage-report</goal>
</goals>
</execution>
</executions>
<configuration>
<coverage>
<runCoverage>true</runCoverage>
<formats>
<format>html</format>
</formats>
</coverage>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerArgs>
<args>-parameters</args>
</compilerArgs>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.2.0</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.connectors</groupId>
<artifactId>mule-salesforce-connector</artifactId>
<version>10.7.0</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.4.0.jre8</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-soapkit-module</artifactId>
<version>1.2.11</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-apikit-module</artifactId>
<version>1.6.1</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-validation-module</artifactId>
<version>2.0.2</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-runner</artifactId>
<version>2.3.13</version>
<classifier>mule-plugin</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-tools</artifactId>
<version>2.3.13</version>
<classifier>mule-plugin</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-spring-module</artifactId>
<version>1.3.6</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.2</version>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-db-connector</artifactId>
<version>1.11.0</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.weave</groupId>
<artifactId>assertions</artifactId>
<version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.5.23</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>org.mule.module</groupId>
<artifactId>mule-java-module</artifactId>
<version>1.2.0</version>
<classifier>mule-plugin</classifier>
</dependency>
</dependencies>
I'm using DynamicEvaluate to process the data, It looks like munit test suit is failing in DynamicEvaluateProcessor bean creation.
I have tried with mock the DynamicEvaluate component with the same values, then also I'm getting the same error message.
Any help would be gratefully appreciated.
Thanks in advance.
It may be related to a fix in a later patch release of Mule 4.4.0. If Studio is using a patched runtime that would explain why it works there. Try changing the version in the pom to the latest patch. See https://docs.mulesoft.com/release-notes/mule-runtime/mule-4.4.0-release-notes to find the latest.
I recommend to upgrade the MUnit version too just in case and remove the
mule-coredependency completely.