Issue facing with Mule maven munit batch testing? - mule

Doing munit(xml) testing for my maven based mule project.
Here is my sample batch only with logger
<batch:job name="sample-mavenBatch">
<batch:input>
<logger message="I am in input phase" level="INFO" doc:name="Logger"/>
</batch:input>
<batch:process-records>
<batch:step name="Batch_Step">
<logger message="I am in processing phase" level="INFO" doc:name="Logger"/>
</batch:step>
</batch:process-records>
<batch:on-complete>
<logger message="I am in complete phase" level="INFO" doc:name="Logger"/>
</batch:on-complete>
</batch:job>
The corresponding test for the flow
<munit:test name="new-test-suite-sample-mavenBatchTest" description="Test">
<munit:set payload="#['rasmita']" doc:name="Set Message"/>
<synchronize:run-and-wait doc:name="Synchronize">
<batch:execute name="sample-mavenBatch" doc:name="Run Batch sample-mavenBatch"/>
</synchronize:run-and-wait>
</munit:test>
This runs me to the following exception
Message
: Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException)
Element : /new-test-suite-sample-mavenBatchTest/processors/1 # b185c7c0-9c20-11e6-9bef-c03fd56639e7
--------------------------------------------------------------------------------
Exception stack is:
Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException)
org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:65)
org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:26)
com.mulesoft.module.batch.engine.queue.BatchQueueLoader.splitAndLoad(BatchQueueLoader.java:63)
(98 more...)
(set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
ERROR - The test new-test-suite-sample-mavenBatchTest finished with an Error.
Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException) (org.mule.api.DefaultMuleException).
org.mule.api.MessagingException: Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException) (org.mule.api.DefaultMuleException).
at sample-mavenBatch.mule:logger{doc:name=Logger, level=INFO, message=I am in input phase}(sample-maven.xml:18)
at sample-mavenBatch.batch:input{}(sample-maven.xml:17)
at new-test-suite-sample-mavenBatchTest.batch:execute{doc:name=Run Batch sample-mavenBatch}(new-test-suite.xml:18)
at new-test-suite-sample-mavenBatchTest.synchronize:run-and-wait{doc:name=Synchronize, timeout=2000, runAsync=false}(new-test-suite.xml:17)
at new-test-suite-sample-mavenBatchTest.munit:set{doc:name=Set Message, payload=rasmita}(new-test-suite.xml:16)
at appleFlow.munit:test{initialState=started, description=Test, ignore=false, abstract=false, id=MunitTestFlow$$EnhancerByMUNIT$$904837f0{new-test-suite-sample-mavenBatchTest}}(new-test-suite.xml:15)
Caused by: org.mule.api.DefaultMuleException: Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException)
at org.mule.config.RunAndWait.process(RunAndWait.java:52)
at org.mule.config.RunAndWait$$EnhancerByMUNIT$$b91d97ea.CGLIB$process$0(<generated>)
at org.mule.config.RunAndWait$$EnhancerByMUNIT$$b91d97ea$$FastClassByMUNIT$$2ac5af50.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at org.mule.munit.common.processor.interceptor.MunitMessageProcessorInterceptor.invokeSuper(MunitMessageProcessorInterceptor.java:95)
at org.mule.munit.common.processor.interceptor.MunitMessageProcessorInterceptor.process(MunitMessageProcessorInterceptor.java:82)
at org.mule.modules.interceptor.processors.AbstractMessageProcessorInterceptor.intercept(AbstractMessageProcessorInterceptor.java:46)
at org.mule.config.RunAndWait$$EnhancerByMUNIT$$b91d97ea.process(<generated>)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.construct.DynamicPipelineMessageProcessor.process(DynamicPipelineMessageProcessor.java:55)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58)
at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:52)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.processor.AbstractRequestResponseMessageProcessor.processBlocking(AbstractRequestResponseMessageProcessor.java:56)
at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.construct.Flow$2.process(Flow.java:138)
at org.mule.construct.Flow$2.process(Flow.java:133)
at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)
at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
at org.mule.execution.ErrorHandlingExecutionTemplate.execute(ErrorHandlingExecutionTemplate.java:60)
at org.mule.execution.ErrorHandlingExecutionTemplate.execute(ErrorHandlingExecutionTemplate.java:30)
at org.mule.construct.Flow.process(Flow.java:132)
at org.mule.munit.assertion.processors.MunitTestFlow.process(MunitTestFlow.java:121)
at org.mule.munit.assertion.processors.MunitTestFlow$$EnhancerByMUNIT$$904837f0.CGLIB$process$0(<generated>)
at org.mule.munit.assertion.processors.MunitTestFlow$$EnhancerByMUNIT$$904837f0$$FastClassByMUNIT$$f664bbef.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at org.mule.munit.common.processor.interceptor.MunitMessageProcessorInterceptor.invokeSuper(MunitMessageProcessorInterceptor.java:95)
at org.mule.munit.common.processor.interceptor.MunitMessageProcessorInterceptor.process(MunitMessageProcessorInterceptor.java:82)
at org.mule.modules.interceptor.processors.AbstractMessageProcessorInterceptor.intercept(AbstractMessageProcessorInterceptor.java:46)
at org.mule.munit.assertion.processors.MunitTestFlow$$EnhancerByMUNIT$$904837f0.process(<generated>)
at org.mule.munit.runner.mule.MunitTest.run(MunitTest.java:108)
at org.mule.munit.runner.mule.MunitSuite.run(MunitSuite.java:49)
at org.mule.munit.runner.mule.MunitSuiteRunner$1.runSuite(MunitSuiteRunner.java:53)
at org.mule.munit.runner.mule.MunitSuiteRunner$1.runSuite(MunitSuiteRunner.java:49)
at org.mule.munit.runner.MunitRunner.run(MunitRunner.java:75)
at org.mule.munit.runner.mule.MunitSuiteRunner.run(MunitSuiteRunner.java:49)
at org.mule.munit.remote.MunitRemoteRunner.runTestSuite(MunitRemoteRunner.java:193)
at org.mule.munit.remote.MunitRemoteRunner.run(MunitRemoteRunner.java:102)
at org.mule.munit.remote.MunitRemoteRunner.main(MunitRemoteRunner.java:76)
Caused by: com.mulesoft.module.batch.exception.BatchException: Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException)
at com.mulesoft.module.batch.engine.DefaultBatchEngine.load(DefaultBatchEngine.java:419)
at com.mulesoft.module.batch.DefaultBatchJob.execute(DefaultBatchJob.java:357)
at com.mulesoft.module.batch.processor.BatchExecuteMessageProcessor.process(BatchExecuteMessageProcessor.java:49)
at com.mulesoft.module.batch.processor.BatchExecuteMessageProcessor$$FastClassByCGLIB$$c5698262.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.mule.munit.common.processor.interceptor.WrapperMunitMessageProcessorInterceptor.invokeSuper(WrapperMunitMessageProcessorInterceptor.java:62)
at org.mule.munit.common.processor.interceptor.MunitMessageProcessorInterceptor.process(MunitMessageProcessorInterceptor.java:82)
at org.mule.munit.common.processor.interceptor.WrapperMunitMessageProcessorInterceptor.intercept(WrapperMunitMessageProcessorInterceptor.java:42)
at com.mulesoft.module.batch.processor.BatchExecuteMessageProcessor$$EnhancerByMUNIT$$c5698262.process(<generated>)
at org.mule.config.RunAndWait$1.process(RunAndWait.java:42)
at org.mule.Synchronizer.runAndWait(Synchronizer.java:39)
at org.mule.config.RunAndWait.process(RunAndWait.java:48)
... 86 more
Caused by: java.lang.IllegalArgumentException: Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}"
at org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:65)
at org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:26)
at com.mulesoft.module.batch.engine.queue.BatchQueueLoader.splitAndLoad(BatchQueueLoader.java:63)
at com.mulesoft.module.batch.engine.DefaultBatchEngine.load(DefaultBatchEngine.java:402)
... 97 more
where as The same test case works in non-maven mule project.
Please help me. Thanks in advance.

This is the issue of the input set in Munit. As error message clearly says
Object "java.lang.String" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException) (org.mule.api.DefaultMuleException).
Batch input should be Iterable, but you have provided String #['rasmita']. Instead of this try to pass array list. You can use MEL or dataweave for the same.
Hope this helps.

I resolved my issues in two ways
1) in Set payload as #anupambhusari said use arraylist, so using MEL #[{'rasmita','ananda'}]
2)With transform message which was throwing the below exception org.threeten.bp.zone.ZoneRulesProvider: Provider org.threeten.bp.zone.TzdbZoneRulesProvider
Added the below dependency.
Test <dependency>
<groupId>com.mulesoft.weave</groupId>
<artifactId>mule-plugin-weave_2.11</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
</exclusion>
</exclusions>
</dependency>

Related

Mule 3.7 transformer with annotations for custom Objects

I have two custom Classes : Person, Manager. I wrote the following transformer to transform Person to Manager object.
package com.learning.transformers;
import org.mule.api.annotations.ContainsTransformerMethods;
import org.mule.api.annotations.Transformer;
import com.learning.beans.Manager;
import com.learning.beans.Person;
#ContainsTransformerMethods
public class AnnotatedTransformer {
#Transformer
public Manager transformToManager(#Payload Person person){
Manager manager = new Manager();
manager.setPerson(person);
manager.setDesignation("Manager");
return manager;
}
}
My configuraiton file is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<spring:beans>
<spring:bean id="anTransformer" name="anT" class="com.learning.transformers.AnnotatedTransformer"/>
</spring:beans>
<flow name="mule-learning-transformersFlow1">
<http:listener config-ref="GlobalHTTPConnector" path="/customTransformation" doc:name="HTTP"/>
<json:json-to-object-transformer returnClass="com.learning.beans.Person" doc:name="JSON to Object"/>
<!-- <auto-transformer returnClass="com.learning.beans.Manager" /> -->
<component class="com.learning.components.ManagerLoggingComponent" doc:name="Java" />
</flow>
</mule>
My ManagerLoggingComponent looks like :
package com.learning.components;
import com.learning.beans.Manager;
import com.learning.beans.Person;
import org.mule.api.annotations.param.Payload;
public class ManagerLoggingComponent {
public void logManager(#Payload Manager manager){
Person person = manager.getPerson();
System.out.println("Name: "+person.getName());
System.out.println("Age: "+person.getAge());
System.out.println("Designation: "+manager.getDesignation());
}
}
I first send some json input to the flow. That is converted to Person object using json-to-object transformer. Then my component is placed which expects Manager object. I have registered my annotated transformer as spring bean. Hence I expect Person object to be converted to Manager object before passing it to Component. But it is throwing following exception.
Message : Failed to transform from "json" to
"com.learning.beans.Manager" Type :
org.mule.api.transformer.TransformerException Code :
MULE_ERROR-109 JavaDoc :
http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html
Transformer : JsonToObject{this=d61a0b,
name='JsonToManager', ignoreBadInput=false,
returnClass=SimpleDataType{type=com.learning.beans.Manager,
mimeType='/', encoding='null'},
sourceTypes=[SimpleDataType{type=java.io.Reader, mimeType='/',
encoding='null'}, SimpleDataType{type=java.net.URL, mimeType='/',
encoding='null'}, SimpleDataType{type=java.io.File, mimeType='/',
encoding='null'}, SimpleDataType{type=java.lang.String,
mimeType='/', encoding='null'},
SimpleDataType{type=java.io.InputStream, mimeType='/',
encoding='null'}, SimpleDataType{type=[B, mimeType='/',
encoding='null'}]}
Also, while starting the server I found that it is throwing the following error by which I understand that it is un-registering the transformToManager transformer. That might be the reason for not picking up my custom transformer. This is being observed in mule 3.7. 3.5 is working smoothly.
WARN 2016-03-27 14:01:06,574 [main] org.mule.config.spring.SpringRegistry: Could not apply shutdown lifecycle to object 'AnnotatedTransformer.transformToManager' after being unregistered.
org.mule.api.lifecycle.InitialisationException: An Expression Evaluator for "payload" is not registered with Mule. Make sure you have the the module for this expression type on your classpath. for example, if you are using an xpath expression you need to have the Mule XML module on your classpath.
at org.mule.expression.transformers.AbstractExpressionTransformer.initialise(AbstractExpressionTransformer.java:85) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.expression.ExpressionAnnotationsHelper.getTransformerForMethodWithAnnotations(ExpressionAnnotationsHelper.java:53) ~[mule-module-annotations-3.7.3.jar:3.7.3]
at org.mule.config.transformer.AnnotatedTransformerProxy.initialise(AnnotatedTransformerProxy.java:109) ~[mule-module-annotations-3.7.3.jar:3.7.3]
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72]
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:237) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.phases.MuleContextInitialisePhase.applyLifecycle(MuleContextInitialisePhase.java:71) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.lifecycle.RegistryLifecycleManager.applyPhase(RegistryLifecycleManager.java:183) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistry.unregisterObject(AbstractRegistry.java:163) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringRegistry$ConfigurableRegistrationDelegate.doRegisterObject(SpringRegistry.java:451) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringRegistry$ConfigurableRegistrationDelegate.registerObject(SpringRegistry.java:405) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringRegistry.registerObject(SpringRegistry.java:253) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistryBroker.registerObject(AbstractRegistryBroker.java:249) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistryBroker.registerObject(AbstractRegistryBroker.java:262) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.MuleRegistryHelper.registerObject(MuleRegistryHelper.java:816) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.registry.MuleRegistryHelper.registerTransformer(MuleRegistryHelper.java:458) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.transformer.AnnotatedTransformerObjectProcessor.process(AnnotatedTransformerObjectProcessor.java:76) ~[mule-module-annotations-3.7.3.jar:3.7.3]
at org.mule.config.spring.processors.TransformerAnnotatedBeanProcessor.postProcessBeforeInitialization(TransformerAnnotatedBeanProcessor.java:30) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753) ~[mule-module-spring-config-3.7.3.jar:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:108) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:104) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:172) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:95) ~[mule-module-spring-config-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:43) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:69) ~[mule-core-3.7.3.jar:3.7.3]
............
My request look like
{
"name":"Sai",
"age" : "100000"
}
Any ideas on what is happening here?
Everything is working as expected in Mule 3.5. Problem is with mule 3.7.
Update 1 : Full log of Excetion:
Message : Failed to transform from "json" to "com.learning.beans.Manager"
Type : org.mule.api.transformer.TransformerException
Code : MULE_ERROR-109
JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html
Transformer : JsonToObject{this=13de431, name='JsonToManager', ignoreBadInput=false, returnClass=SimpleDataType{type=com.learning.beans.Manager, mimeType='*/*', encoding='null'}, sourceTypes=[SimpleDataType{type=java.io.Reader, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.net.URL, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.io.File, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}, SimpleDataType{type=java.io.InputStream, mimeType='*/*', encoding='null'}, SimpleDataType{type=[B, mimeType='*/*', encoding='null'}]}
********************************************************************************
Exception stack is:
1. null (java.lang.NullPointerException)
java.io.Reader:78 (null)
2. Failed to transform from "json" to "com.learning.beans.Manager" (org.mule.api.transformer.TransformerException)
org.mule.module.json.transformers.JsonToObject:133 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerException.html)
********************************************************************************
Root Exception stack trace:
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:78)
at java.io.InputStreamReader.<init>(InputStreamReader.java:97)
at org.mule.module.json.transformers.JsonToObject.transformMessage(JsonToObject.java:119)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:425)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:373)
at org.mule.expression.MessagePayloadExpressionEvaluator.evaluate(MessagePayloadExpressionEvaluator.java:79)
at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:318)
at org.mule.expression.transformers.ExpressionArgument.evaluate(ExpressionArgument.java:116)
at org.mule.expression.transformers.ExpressionTransformer.transformMessage(ExpressionTransformer.java:51)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:366)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadFromMessageWithAnnotations(AnnotatedEntryPointResolver.java:175)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadForMethod(AnnotatedEntryPointResolver.java:161)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.invoke(AnnotatedEntryPointResolver.java:130)
at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:36)
at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:339)
at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:82)
at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:73)
at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:120)
at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:55)
at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:236)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.component.AbstractComponent.process(AbstractComponent.java:154)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.e...
********************************************************************************
Update 2 : I started getting the below exception suddenly. I didn't change any code. It is showing the below exception some times and above exception some other times.
Message : The object transformed is of type: "SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}", but the expected return type is "SimpleDataType{type=com.learning.beans.Manager, mimeType='application/json', encoding='null'}". The current MuleMessage is null! Please report this to mule-esb#mulesoft.com
Type : org.mule.api.transformer.TransformerMessagingException
Code : MULE_ERROR--2
JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerMessagingException.html
Payload : {NullPayload}
********************************************************************************
Exception stack is:
1. The object transformed is of type: "SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}", but the expected return type is "SimpleDataType{type=com.learning.beans.Manager, mimeType='application/json', encoding='null'}". The current MuleMessage is null! Please report this to mule-esb#mulesoft.com (org.mule.api.transformer.TransformerMessagingException)
org.mule.transformer.AbstractMessageTransformer:179 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transformer/TransformerMessagingException.html)
********************************************************************************
Root Exception stack trace:
org.mule.api.transformer.TransformerMessagingException: The object transformed is of type: "SimpleDataType{type=java.lang.String, mimeType='*/*', encoding='null'}", but the expected return type is "SimpleDataType{type=com.learning.beans.Manager, mimeType='application/json', encoding='null'}". The current MuleMessage is null! Please report this to mule-esb#mulesoft.com
at org.mule.transformer.AbstractMessageTransformer.checkReturnClass(AbstractMessageTransformer.java:179)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:158)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:425)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:373)
at org.mule.expression.MessagePayloadExpressionEvaluator.evaluate(MessagePayloadExpressionEvaluator.java:79)
at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:318)
at org.mule.expression.transformers.ExpressionArgument.evaluate(ExpressionArgument.java:116)
at org.mule.expression.transformers.ExpressionTransformer.transformMessage(ExpressionTransformer.java:51)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141)
at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:69)
at org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:366)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadFromMessageWithAnnotations(AnnotatedEntryPointResolver.java:175)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.getPayloadForMethod(AnnotatedEntryPointResolver.java:161)
at org.mule.impl.model.resolvers.AnnotatedEntryPointResolver.invoke(AnnotatedEntryPointResolver.java:130)
at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:36)
at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:339)
at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:82)
at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:73)
at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:120)
at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:55)
at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:236)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.component.AbstractComponent.process(AbstractComponent.java:154)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.m...
********************************************************************************

how do a merge of sql server with mule?

I have done this with a foreach and execute dll operation, but when try insert o uptdate a string throw a exeption, however with a int values works.
The exeption:`Exception stack is:
1. Invalid column name 'Carlos'. (com.microsoft.sqlserver.jdbc.SQLServerException)
com.microsoft.sqlserver.jdbc.SQLServerException:217 (null)
2. Invalid column name 'Carlos'. (com.microsoft.sqlserver.jdbc.SQLServerException). Message payload is of type: LinkedHashMap (org.mule.api.MessagingException)
org.mule.module.db.internal.processor.AbstractDbMessageProcessor:93 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
********************************************************************************
Root Exception stack trace:
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'Carlos'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(SQLServerStatement.java:2198)
at org.mule.module.db.internal.domain.autogeneratedkey.NoAutoGeneratedKeyStrategy.executeUpdate(NoAutoGeneratedKeyStrategy.java:59)
at org.mule.module.db.internal.domain.executor.UpdateExecutor.doExecuteQuery(UpdateExecutor.java:43)
at org.mule.module.db.internal.domain.executor.UpdateExecutor.doExecuteQuery(UpdateExecutor.java:37)
at org.mule.module.db.internal.domain.executor.AbstractSingleQueryExecutor.execute(AbstractSingleQueryExecutor.java:38)
at org.mule.module.db.internal.processor.ExecuteDdlMessageProcessor.doExecuteQuery(ExecuteDdlMessageProcessor.java:53)
at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:42)
at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.routing.outbound.AbstractMessageSequenceSplitter.processParts(AbstractMessageSequenceSplitter.java:129)
at org.mule.routing.outbound.AbstractMessageSequenceSplitter.process(AbstractMessageSequenceSplitter.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.routing.Foreach.process(Foreach.java:94)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58)
at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)
at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:123)
at o...
********************************************************************************
`
'Carlos' is a value from the payload.
This is the DLL
BEGIN MERGE [FP].[Profile] AS DESTINO USING (SELECT #[payload.ID]) AS
FUENTE (ID) ON (DESTINO.ID=FUENTE.ID) WHEN MATCHED THEN UPDATE SET
[UserId]= #[payload.UserId] WHEN NOT MATCHED THEN INSERT
(ID,UserId,ExternalId,FirstName) VALUES (#[payload.ID],#
[payload.UserId],#[payload.ExternalId],#[payload.FirstName]); END
The XML Flow:
<flow name="insertprofilesindwFlow">
<file:inbound-endpoint path="C:\Users\LBonaventura\Documents\MuleFilesFromDB" responseTimeout="10000" doc:name="Read the file with the profiles" moveToDirectory="C:\Users\LBonaventura\Documents\MuleFilesFromDB" pollingFrequency="864000000"/>
<dw:transform-message metadata:id="57e39ab0-6c79-4118-a57e-fe6561a04e9b" doc:name="Transform Message to map">
<dw:input-payload doc:sample="list_csv_1.csv"/>
<dw:set-payload><![CDATA[%dw 1.0 %output application/java ---payload map ((payload01 , indexOfPayload01) -> {
ID: payload01.ID,
ExternalId: payload01.ID as :string,
UserId: payload01.UserId,
FirstName: payload01.FirstName,
LastName: payload01.LastName,
(DateOfBirth: payload01.DateOfBirth as :string) when payload01.DateOfBirth != "",
(DateOfBirth: null) when payload01.DateOfBirth=="",
(Gender:"M") when payload01.Gender=="1",
(Gender:"F") when payload01.Gender=="0",
(Gender:null) when payload01.Gender=="",
AllowTracking: payload01.AllowTracking,
Email: payload01.AlertEmail,
MainProfile: payload01.Main,
Active: payload01.Active as :boolean,
CreatedOn: payload01.DateAdded as :string,
UpdatedOn: payload01.DateUpdated as :string,
LanguageIso: "ESP",
Deleted: false})]]></dw:set-payload>
</dw:transform-message>
<foreach doc:name="For Each Profile">
<db:execute-ddl config-ref="FOX_DW_DATABASE_CONFIGURATION" doc:name="Upsert in the Database">
<db:dynamic-query><![CDATA[BEGIN MERGE [FP].[Profile] AS DESTINO
USING (SELECT #[payload.ID]) AS FUENTE (ID)
ON (DESTINO.ID=FUENTE.ID)
WHEN MATCHED THEN
UPDATE SET
[UserId]= #[payload.UserId],
[FirstName]=#[payload.FirstName]
WHEN NOT MATCHED THEN
INSERT
(ID,UserId,ExternalId,[FirstName])
VALUES
(#[payload.ID],#[payload.UserId],#[payload.ExternalId],#[payload.FirstName]); END]]></db:dynamic-query>
</db:execute-ddl>
</foreach>
</flow>
When working with dynamic query there is no parameter conversion, for this reason you need to add quotes to string arguments, so in your case it should look something like that:
<db:dynamic-query><![CDATA[BEGIN MERGE [FP].[Profile] AS DESTINO
USING (SELECT #[payload.ID]) AS FUENTE (ID)
ON (DESTINO.ID=FUENTE.ID)
WHEN MATCHED THEN
UPDATE SET
[UserId]= '#[payload.UserId]',
[FirstName]=#[payload.FirstName]
WHEN NOT MATCHED THEN
INSERT
(ID,UserId,ExternalId,[FirstName])
VALUES
(#[payload.ID],'#[payload.UserId]',#[payload.ExternalId],'#[payload.FirstName]'); END]]></db:dynamic-query>
Just one note on security: Pay attention when using dynamic query, you are vulnerable to SQL Injection in this way, so make sure you sanitize this parameters before passing it to the DLL.

Munit test case fails when trying to mock sfdc endpoint

I am trying to mock an sfdc-endpoint .But in my actual flow this endpoint return some value.When i am trying to return any value through mocking this endpoint it is throwing an exception as:
org.mule.api.MessagingException: Execution of the expression "payload.size()" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: String
at org.mule.el.mvel.MVELExpressionLanguage.evaluateInternal(MVELExpressionLanguage.java:202)
at org.mule.el.mvel.MVELExpressionLanguage.evaluate(MVELExpressionLanguage.java:154)
at org.mule.el.mvel.MVELExpressionLanguage.evaluate(MVELExpressionLanguage.java:133)
at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:215)
at org.mule.expression.DefaultExpressionManager$2.match(DefaultExpressionManager.java:476)
at org.mule.util.TemplateParser.parse(TemplateParser.java:149)
at org.mule.util.TemplateParser.parse(TemplateParser.java:126)
at org.mule.expression.DefaultExpressionManager.parse(DefaultExpressionManager.java:472)
at org.mule.expression.DefaultExpressionManager.parse(DefaultExpressionManager.java:431)
at org.mule.api.processor.LoggerMessageProcessor.log(LoggerMessageProcessor.java:88)
at org.mule.api.processor.LoggerMessageProcessor.process(LoggerMessageProcessor.java:67)
at org.mule.api.processor.LoggerMessageProcessor$$EnhancerByMUNIT$$5003da6e.CGLIB$process$1(<generated>)
at org.mule.api.processor.LoggerMessageProcessor$$EnhancerByMUNIT$$5003da6e$$FastClassByMUNIT$$60cdcd72.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at org.mule.munit.common.mp.MunitMessageProcessorInterceptor.invokeSuper(MunitMessageProcessorInterceptor.java:66)
at org.mule.munit.common.mp.MunitMessageProcessorInterceptor.process(MunitMessageProcessorInterceptor.java:59)
at org.mule.modules.interceptor.processors.AbstractMessageProcessorInterceptor.intercept(AbstractMessageProcessorInterceptor.java:44)
at org.mule.api.processor.LoggerMessageProcessor$$EnhancerByMUNIT$$5003da6e.process(<generated>)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:97)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.construct.DynamicPipelineMessageProcessor.process(DynamicPipelineMessageProcessor.java:54)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:51)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:40)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.construct.AbstractPipeline$1.process(AbstractPipeline.java:109)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.construct.Flow$1.process(Flow.java:82)
at org.mule.construct.Flow$1.process(Flow.java:77)
at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
at org.mule.execution.ErrorHandlingExecutionTemplate.execute(ErrorHandlingExecutionTemplate.java:59)
at org.mule.execution.ErrorHandlingExecutionTemplate.execute(ErrorHandlingExecutionTemplate.java:30)
at org.mule.construct.Flow.process(Flow.java:76)
at org.mule.construct.Flow$$EnhancerByMUNIT$$bb7e3368.CGLIB$process$0(<generated>)
at org.mule.construct.Flow$$EnhancerByMUNIT$$bb7e3368$$FastClassByMUNIT$$45e5ae9e.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at org.mule.munit.common.mp.MunitMessageProcessorInterceptor.invokeSuper(MunitMessageProcessorInterceptor.java:66)
at org.mule.munit.common.mp.MunitMessageProcessorInterceptor.process(MunitMessageProcessorInterceptor.java:59)
at org.mule.modules.interceptor.processors.AbstractMessageProcessorInterceptor.intercept(AbstractMessageProcessorInterceptor.java:44)
at org.mule.construct.Flow$$EnhancerByMUNIT$$bb7e3368.process(<generated>)
at org.mule.munit.runner.functional.FunctionalMunitSuite.runFlow(FunctionalMunitSuite.java:261)
at mule_work_with_form.TestGetEmployeeFlow.validateEchoFlow(TestGetEmployeeFlow.java:56)
Caused by: org.mule.mvel2.PropertyAccessException: [Error: unable to resolve method: java.lang.String.size() [arglength=0]]
[Near : {... payload.size() ....}]
^
[Line: 1, Column: 1]
at org.mule.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:1084)
at org.mule.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:993)
at org.mule.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:343)
I am using Munit-3.5-m2 .
Not sure if you can not mock the connector.
You see, the exception is pointing to a MEL error when executing a MEL expression and it's complaining that whatever the payload is when reaching that expression it doesn't have a size() method.
It actually says that the payload is a string and that has not size method:
Caused by: org.mule.mvel2.PropertyAccessException: [Error: unable to resolve method: java.lang.String.size() [arglength=0]]
[Near : {... payload.size() ....}]
I reckon you're expecting that payload to be a list or a collection.
I'll start looking the error there.
If you still find problems with that please share the code of the failing test and the one of the flow trying to be tested.
HTH

MuleSoft Proxy Settings not working for AMAZON SQS

We are trying to connect with amazon SQS from our corporate network. But its throwing below error
I have added Proxy details
VM Arguments in Run configurations:
Dhttp.proxyHost=rb-proxy-apac.bosch.com -Dhttp.proxyPort=8080 -Dhttp.proxyUser=prd5kor -Dhttp.proxyPassword=
Dmule.verbose.exceptions=true
Global Element properties:HTTP-HTTPS--->Proxy Settings
Prefernces-->General-->Network Connections( Active Provider-Manual)
Mule Config.XML:
`<http:connector name="HTTP_HTTPS" cookieSpec="rfc2109" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" proxyHostname="rb-proxy-apac.bosch.com" proxyPort="8080" proxyUsername="prd5kor" proxyPassword="Bibhushree#12345" doc:name="HTTP-HTTPS"/>
<sqs:config name="SQS_AMAZON" accessKey="------" secretKey="-----" queueName="bibhushree" doc:name="Amazon SQS"/>
<file:file-to-string-transformer name="File_to_String" doc:name="File to String"/>
<flow name="sqs_projectFlow2" doc:name="sqs_projectFlow2">
<ftp:inbound-endpoint host="bmhe321649.BMH.APAC.BOSCH.COM" port="21" path="/MULE" user="prd5kor" password="------" responseTimeout="10000" transformer-refs="File_to_String" doc:name="FTP"/>
<sqs:send-message config-ref="SQS_AMAZON" queueUrl="https://sqs.us-west-2.amazonaws.com/189129605181/bibhushree" accessKey="-----" secretKey="---------" queueName="bibhushree" doc:name="Amazon SQS"/>
<logger message="Received a message: #[payload]" level="INFO" doc:name="Logger"/>`
Error:
`java.net.UnknownHostException: sqs.us-east-1.amazonaws.com
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:278)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:641)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:402)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:245)
at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2221)
at com.amazonaws.services.sqs.AmazonSQSClient.createQueue(AmazonSQSClient.java:1150)
at org.mule.modules.sqs.SQSConnector.connect(SQSConnector.java:102)
at org.mule.modules.sqs.connectivity.SQSConnectorConnectionFactory.makeObject(SQSConnectorConnectionFactory.java:50)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.mule.modules.sqs.connectivity.SQSConnectorConnectionManager.acquireConnection(SQSConnectorConnectionManager.java:254)
at org.mule.modules.sqs.connectivity.SQSConnectorConnectionManager.acquireConnection(SQSConnectorConnectionManager.java:40)
at org.mule.modules.sqs.process.ManagedConnectionProcessInterceptor.execute(ManagedConnectionProcessInterceptor.java:65)
at org.mule.modules.sqs.process.ManagedConnectionProcessInterceptor.execute(ManagedConnectionProcessInterceptor.java:23)
at org.mule.security.oauth.process.RetryProcessInterceptor.execute(RetryProcessInterceptor.java:84)
at org.mule.modules.sqs.connectivity.ManagedConnectionProcessTemplate.execute(ManagedConnectionProcessTemplate.java:35)
at org.mule.modules.sqs.processors.SendMessageMessageProcessor.doProcess(SendMessageMessageProcessor.java:131)
at org.mule.devkit.processor.DevkitBasedMessageProcessor.process(DevkitBasedMessageProcessor.java:86)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:51)
at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:118)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:189)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:182)
at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)
at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExec...`
I'm afraid the SQS connector doesn't seems to honor the proxy settings.
I've just raised an issue on the project around this.

Mule is throwing error: No namespace on "someElement" element

I provided snippet of my code that should work normally but it doesn't.
In short, my flow is triggered by quartz, read some data from database, loop through results, on each loop do something and then finish.
Everything works ok when result from service (http outbound) return that there is nothing to give back, but when choice (in flow) is not default it redirect to sub-flow where xslt perform and save file. File saves like it should (I checked with external tools if xml suits criteria) and logger prints out number 3 as proof that it is finished (couple of lines before error is thrown) but after that I get error given below. Anyone knows why? I am out of ideas.
My flow:
<flow name="msp2bassGettingContent" doc:name="Starter">
<quartz:inbound-endpoint responseTimeout="10000" doc:name="Quartz" jobName="Starter" repeatInterval="600000" startDelay="3000">
<quartz:event-generator-job groupName="Generator" jobGroupName="Generator">
<quartz:payload file="${prop.requestEvent}"/>
</quartz:event-generator-job>
</quartz:inbound-endpoint>
<jdbc:outbound-endpoint exchange-pattern="request-response" queryKey="getUnreadedRoutes" queryTimeout="-1" connector-ref="JDBCConnector" doc:name="GetNulls">
<jdbc:query key="getUnreadedRoutes" value="SELECT routeid FROM kptemp WHERE readed IS NULL"/>
</jdbc:outbound-endpoint>
<foreach collection="#[message.payload]" doc:name="For Each" counterVariableName="counter123">
<flow-ref name="msp2bass" doc:name="Flow Reference"/>
</foreach>
</flow>
<sub-flow name="msp2bass" doc:name="msp2bassGetEvent">
<set-variable variableName="routeid" value="#[payload['routeid']]" doc:name="Variable"/>
<set-payload value="<a/>;" doc:name="Set Payload"/>
<mulexml:object-to-xml-transformer doc:name="Object to XML"/>
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="${prop.createRequest}" doc:name="XSLT" ignoreBadInput="true">
<mulexml:context-property key="customerId" value="${prop.customerId}"/>
<mulexml:context-property key="siteName" value="${prop.siteName}"/>
<mulexml:context-property key="routeID" value="#[routeid]"/>
</mulexml:xslt-transformer>
<cxf:proxy-client payload="body" doc:name="SOAP">
<cxf:outInterceptors>
<spring:ref bean="WSS4JOutInterceptorBean"/>
</cxf:outInterceptors>
</cxf:proxy-client>
<https:outbound-endpoint exchange-pattern="request-response" host="${prop.host}" port="${prop.port}" path="${prop.path}" method="POST" connector-ref="HTTP_HTTPS1" doc:name="HTTP"/>
<byte-array-to-object-transformer doc:name="Byte Array to Object"/>
<choice doc:name="Choice">
<when expression="#[xpath('boolean(//soap:Envelope/soap:Body/ns2:processComplexResponse/MSPResponse/serviceEvents/measurements/name)')]">
<flow-ref name="transform" doc:name="Flow Reference"/>
</when>
<otherwise>
<logger message="Not null: #[routeid]" level="INFO" doc:name="Logger"/>
</otherwise>
</choice>
</sub-flow>
<sub-flow name="transform" doc:name="transform">
<logger message="Payload: #[payload]" level="INFO" doc:name="Logger"/>
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="${prop.transformer}" doc:name="XSLT"/>
<file:outbound-endpoint path="./work" outputPattern="#[routeid].xml" responseTimeout="10000" disableTransportTransformer="true" doc:name="File"/>
<logger message="3" level="INFO" doc:name="3"/>
</sub-flow>
Stack trace:
INFO 2014-01-22 12:30:21,999 [[bass2msp].msp2bassGettingContent.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Not null: IR_1389972193818
INFO 2014-01-22 12:30:22,252 [[bass2msp].msp2bassGettingContent.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Payload: SOME XML CONTENT
INFO 2014-01-22 12:30:22,301 [[bass2msp].msp2bassGettingContent.stage1.02] org.mule.api.processor.LoggerMessageProcessor: 3
WARN 2014-01-22 12:17:56,335 [[bass2msp].msp2bassGettingContent.stage1.04] org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://support.cxf.module.mule.org/}ProxyService#{http://support.cxf.module.mule.org/}invoke has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: No namespace on "rootNode" element.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:109)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:141)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:799)
at org.mule.module.cxf.transport.MuleUniversalConduit.dispatchMuleMessage(MuleUniversalConduit.java:280)
at org.mule.module.cxf.transport.MuleUniversalConduit$2.handleMessage(MuleUniversalConduit.java:194)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:375)
at org.mule.module.cxf.CxfOutboundMessageProcessor.doSendWithClient(CxfOutboundMessageProcessor.java:235)
at org.mule.module.cxf.CxfOutboundMessageProcessor.process(CxfOutboundMessageProcessor.java:125)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:95)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:54)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:26)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:70)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:65)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:106)
at org.mule.routing.outbound.AbstractMessageSequenceSplitter.processParts(AbstractMessageSequenceSplitter.java:133)
at org.mule.routing.outbound.AbstractMessageSequenceSplitter.process(AbstractMessageSequenceSplitter.java:63)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:95)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:54)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:26)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:70)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:65)
at org.mule.routing.Foreach.process(Foreach.java:95)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:95)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:106)
at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:122)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:192)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:185)
at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:20)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:34)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:18)
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:58)
at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:48)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:54)
at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:44)
at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:44)
at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:52)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:32)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:17)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:113)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:34)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:184)
at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)
at org.mule.work.WorkerContext.run(WorkerContext.java:311)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
ERROR 2014-01-22 12:17:56,340 [[bass2msp].msp2bassGettingContent.stage1.04] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : No namespace on "rootNode" element.. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. No namespace on "rootNode" element. (org.apache.cxf.binding.soap.SoapFault)
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor:109 (null)
2. No namespace on "rootNode" element.. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod (org.mule.api.transport.DispatchException)
org.mule.module.cxf.CxfOutboundMessageProcessor:144 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.apache.cxf.binding.soap.SoapFault: No namespace on "rootNode" element.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:109)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:141)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
Any help is appreciated! Thank you!
EDIT.1
I did some more research and I found out that problem is when call to subflow in my loop (for each) end. I have put logger after flow-ref and it printed ok till that error (file at the end of flow is generated but logger is quiet). So, is this known/unknown bug or something? Or do I somehow rewrite collection that is looping here: message.payload so that looper cannot read next value? But then, why logger after flow-ref doesn't get triggered inside loop at the end?
The cxf:proxy-client element is a "two way" element, i.e. it deals with the message both in request and response phases.
The "transform" sub-flow affects the message payload, which was the response from the HTTP endpoint, with an XSL-T. This confuses the cxf:proxy-client element when it eventually gets the response back flowing through it.
One potential fix is to ref the sub-flow in an async block so whatever payload transformation it will do won't be visible to the calling flow, but this will change the response of "msp2bass".
Another option would consist in putting the byte-array-to-object-transformer and choice elements in a response block above the cxf:proxy-client, that way you would affect the response after CFX so it would stop complaining.