I am trying to add custom validation against a generated request object for incoming JSON payload using the javax.validation framework and openapi-generator-maven-plugin in Mule ESB.
I am following the below mulesoft documentation :
https://docs.mulesoft.com/mule-runtime/3.9/building-a-custom-validator
I have added the below custom validation :
<validation:custom-validator doc:name="Validation" class="com.poltu.validation.CustomValidator" />
But when I amtrying to run the application ,it fails with the below message :
Invalid content was found starting with element 'validation:custom-validator'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected.
Edit :
below is the xml configuration that I am now using :
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:validation="http://www.mulesoft.org/schema/mule/validation"
xmlns:xml-module="http://www.mulesoft.org/schema/mule/xml-module"
xmlns:json="http://www.mulesoft.org/schema/mule/json"
xmlns:java="http://www.mulesoft.org/schema/mule/java"
xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:db="http://www.mulesoft.org/schema/mule/db"
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:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/json
http://www.mulesoft.org/schema/mule/json/current/mule-json.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/db
http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/ee/core
http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/java
http://www.mulesoft.org/schema/mule/java/current/mule-java.xsd
http://www.mulesoft.org/schema/mule/xml-module
http://www.mulesoft.org/schema/mule/xml-module/current/mule-xml-module.xsd
http://www.mulesoft.org/schema/mule/validation
http://www.mulesoft.org/schema/mule/validation/current/mule-validation.xsd">
<db:config name="Database_Config" doc:name="Database Config"
doc:id="d31ea473-7b58-4d28-83b3-bed7e0bebf2c" >
<db:oracle-connection host="localhost" user="system" password="system"
instance="xe" />
</db:config>
<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener
config" doc:id="78fddb86-0942-4ccf-a300-2d721291c964" basePath="/emp_service"
>
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<flow name="mule1Flow" doc:id="246fb555-ea4b-4b9f-bf2c-a332dc3a0ea1" >
<http:listener doc:name="Add_emp_Listener" doc:id="a9d8ff2a-00a7-4759-
8c0f-c53b9211e0e9" config-ref="HTTP_Listener_config" path="add_emp"
allowedMethods="POST"/>
<validation:custom-validator doc:name="validation"
class="com.poltu.validation.CustomValidator" />
<db:insert doc:name="Insert" doc:id="d44b5680-ae0a-4e97-8c91-
9baba4039e7e" config-ref="Database_Config">
<db:sql ><![CDATA[insert into emp_details
values(:emp_id,:emp_name,:emp_status)]]></db:sql>
<db:input-parameters ><![CDATA[#[{
"emp_id": payload.emp_id,
"emp_name" : payload.emp_name,
"emp_status" : payload.emp_status
}]]]></db:input-parameters>
</db:insert>
<ee:transform doc:name="Transform Message" doc:id="7e7be7f4-c2fc-43f9-
8b76-bf63bf8ac51b" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
"status":"OK",
"response":"Created re bhaii...."
}]]></ee:set-payload>
</ee:message>
</ee:transform>
<logger level="INFO" doc:name="Logger" doc:id="647043ee-5a28-414e-898e-
dce291114c2c" message="response payload is -- #[payload.response]"/>
</flow>
</mule>
The documentation that you are using is for Mule 3.9. That method is not compatible with Mule 4. To create a custom validator in Mule 4 you need to create a Mule Extension with the Mule SDK for Java. Follow the instructions to create the module. Once your module builds, add a validator operation as described at https://docs.mulesoft.com/mule-runtime/4.3/migration-module-validation#custom_validator
Related
I tried using FTP connector and FileZilla FTP server (xampp).
Here is my flow code and output. In case when I'm using SFTP I'm getting output as "connection is closed by foreign host".
Configuration XML:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:sftp="http://www.mulesoft.org/schema/mule/sftp" xmlns:ftp="http://www.mulesoft.org/schema/mule/ee/ftp" 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/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/ftp http://www.mulesoft.org/schema/mule/ee/ftp/current/mule-ftp-ee.xsd
http://www.mulesoft.org/schema/mule/sftp http://www.mulesoft.org/schema/mule/sftp/current/mule-sftp.xsd">
<file:connector name="FileRead" readFromDirectory="D:\Data\input" autoDelete="false" streaming="true" validateConnections="true" doc:name="File"/>
<ftp:connector name="FTP" pollingFrequency="1000" validateConnections="true" outputPattern="output.json" doc:name="FTP"/>
<flow name="ftpFlow">
<file:inbound-endpoint path="D:\Data\input" connector-ref="FileRead" pollingFrequency="100000" responseTimeout="10000" doc:name="File"/>
<ftp:outbound-endpoint host="127.0.0.1" port="14147" passive="true" responseTimeout="10000" doc:name="FTP" connector-ref="FTP" outputPattern="output.json" password="kamal" path="/" user="kamal"/>
</flow>
</mule>
Console Output:
INFO 2018-03-01 13:00:07,218 [[ftp].FileRead.receiver.01] org.mule.transport.file.FileMessageReceiver: Lock obtained on file: D:\Data\input\example.json
INFO 2018-03-01 13:00:07,300 [[ftp].FTP.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'FTP.dispatcher.145993108'. Object is: FtpMessageDispatcher
INFO 2018-03-01 13:00:07,305 [[ftp].FTP.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'FTP.dispatcher.145993108'. Object is: FtpMessageDispatcher
ERROR 2018-03-01 13:01:12,866 [[ftp].FTP.dispatcher.01] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: EEFtpConnector
{
name=FTP
lifecycle=start
this=608b1fd2
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[ftp]
serviceOverrides=<none>
}
. Root Exception was: Could not parse response code.
Server Reply: FZS
Listening port of File Zilla was 21. Port 14147 is administration port.
Use the little small groovy script provided in that.This should work .I just tested this and working as expected .Deleting can be done by autoDelete attribute or fileAge .Please let me know if this helps
<flow name="ftptestFlow">
<ftp:inbound-endpoint host="hostname" port="port" path="path/filename" user="userid" password="password" responseTimeout="10000" doc:name="FTP"/>
<set-variable variableName="fileName" value="fileName" doc:name="fileName"/>
<scripting:component doc:name="getFile">
<scripting:script engine="Groovy"><![CDATA[new File(flowVars.fileName).getText('UTF-8')]]></scripting:script>
</scripting:component>
<file:outbound-endpoint path="path" outputPattern="filename" responseTimeout="10000" doc:name="File"/>
</flow>
I'm getting an error:
Caused by: org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 44; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aws-messaging:sqs-async-client'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:452)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3230)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1911)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:760)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Confin.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
I'm using the following xsd's:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aws-messaging="http://www.springframework.org/schema/c"
xmlns:int-aws="http://www.springframework.org/schema/c"
xmlns:aws-context="http://www.springframework.org/schema/p"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd"
default-lazy-init="true">
<description>
Connects to SQS, fetches the compressed payload and sends to
uncompress channel
Step 1 of the flow
</description>
<aws-messaging:sqs-async-client id="sqs"/>
<aws-context:context-credentials>
<aws-context:simple-credentials access-key="${aws.accesskey}"
secret-key="${aws.secretkey}"/>
</aws-context:context-credentials>
This used to work before. I used this as a template: https://github.com/spring-projects/spring-integration-aws/blob/master/src/test/java/org/springframework/integration/aws/config/xml/SqsMessageHandlerParserTests-context.xml
Can you please help? Did something change?
Look , what you have for namespace prefixes:
xmlns:aws-messaging="http://www.springframework.org/schema/c"
xmlns:int-aws="http://www.springframework.org/schema/c"
xmlns:aws-context="http://www.springframework.org/schema/c"
And what has to be:
xmlns:int-aws="http://www.springframework.org/schema/integration/aws"
xmlns:aws-messaging="http://www.springframework.org/schema/cloud/aws/messaging"
xmlns:aws-context="http://www.springframework.org/schema/cloud/aws/context"
Plus you have to add their schemaLocations as well:
http://www.springframework.org/schema/integration/aws http://www.springframework.org/schema/integration/aws/spring-integration-aws.xsd
http://www.springframework.org/schema/cloud/aws/messaging http://www.springframework.org/schema/cloud/aws/messaging/spring-cloud-aws-messaging.xsd
http://www.springframework.org/schema/cloud/aws/context http://www.springframework.org/schema/cloud/aws/context/spring-cloud-aws-context.xsd
My requirement is to authenticate the user (with an external ws) as part of my Mule Flow and use the result of the authentication in a cache. however, if the user credentials change, then the cache should be automatically invalidated and user auth must be done with the external ws. Basically the cache key should be based on the user credentials. Is this possible ?
Here's my mule flow and i see that Mule is caching the results after the first request and irrespective of whether or not the payload changes in subsequent requests ( which is where the credentials are sent ) mule always returns the results from the cache. So when the first request has incorrect credentials, user auth fails and mule caches the response. From this point onwards, irrespective of sending correct credentials in subsequent requests, it always refers to the cache and returns user auth failure. How do I achieve what I wanted to achieve ?
Here's my mule flow:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" 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" version="EE-3.6.0"
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/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<http:listener-config name="HTTP-Inbound-Endpoint" host="0.0.0.0" port="8888" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="10.10.10.10" port="8080" doc:name="HTTP Request Configuration"/>
<ee:object-store-caching-strategy name="Auth-Cache-Strategy" doc:name="Caching Strategy">
<in-memory-store name="UserAuthCache" maxEntries="100" entryTTL="3600" expirationInterval="3600"/>
</ee:object-store-caching-strategy>
<flow name="cacheauthenticationFlow">
<http:listener config-ref="HTTP-Inbound-Endpoint" path="*" doc:name="HTTP"/>
<object-to-string-transformer doc:name="Object to String"/>
<ee:cache cachingStrategy-ref="Auth-Cache-Strategy" doc:name="Cache">
<logger message="Incoming: #[message.payload]" level="INFO" doc:name="Logger"/>
<scripting:transformer doc:name="Python">
<scripting:script engine="jython"><![CDATA[import base64
authorization = message.getInboundProperty("authorization")
#print "Authorization is: \"" + authorization + "\""
authstring = authorization.split()
#print authstring
credentials = authstring[-1]
#print "Credentials => " + credentials
decodedAuth = credentials.decode('base64')
#print decodedAuth
if (decodedAuth.find("#") > 0):
(id, password) = decodedAuth.split(":")
(username, project) = id.split("#")
print username + ":" + password + ", Project: " + project
else:
(username, password) = decodedAuth.split(":")
print username + ":" + password
message.payload = { "username" : username + "#" + project , "password" : password }
result = message]]></scripting:script>
</scripting:transformer>
<json:object-to-json-transformer doc:name="Object to JSON"/>
<logger message="Incoming payload: #[message.payload]" level="INFO" doc:name="Logger"/>
<http:request config-ref="HTTP_Request_Configuration" path="/wservices/authenticate/user" method="POST" doc:name="HTTP-Dev-Box-Authentication"/>
<object-to-string-transformer doc:name="Object to String"/>
</ee:cache>
<logger message="Response From Cache: #[message.payload]" level="INFO" doc:name="Logger"/>
<set-payload value="#[message.payload.'status']" doc:name="Response"/>
</flow>
</mule>
Since the default key generation strategy for the cache scope is based on the message payload an option in your particular case would be to simply move the scripting:transformer to be executed before the ee:cache scope.
For a more general solution, where you do not want to overwrite your request payload, you can define the keyGenerationExpression or keyGenerator-refattribute on the ee:cache element to control how the cache key i generated.
For example to use the complete HTTP authorization header as key you could use:
<ee:cache cachingStrategy-ref="Auth-Cache-Strategy" doc:name="Cache"
keyGenerationExpression="#[message.inboundProperties.authorization]">
<!-- Your flow here -->
</ee:cache>
See the cache scope documentation for more information.
If you want to use this approach you could do is move parts of your jython code outside the cache scope, change it so that it sets the user and password as separate flow variables on the message and then use them in the keyGenerationExpression and then again later inside the cache scope in a simple set-payload transformer.
You can define a global configuration "Caching_Strategy":
<ee:object-store-caching-strategy name="Caching_Strategy" keyGenerationExpression="#[flowVars.userID]" doc:name="Caching Strategy"/>
and refer the global configuration in cache flow:
<ee:cache doc:name="Cache" cachingStrategy-ref="Caching_Strategy">
<!-- flow -->
</ee:cache>
You can control your keyGenerationExpression by the flow variable #[flowVars.userID]
For complete detail with example refer
http://www.tutorialsatoz.com/caching-in-mule-cache-scope/
Below is my test-config.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:test="http://www.mulesoft.org/schema/mule/test"
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" version="EE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
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/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/current/mule-test.xsd ">
...
<flow name="mock_receiver" doc:name="mock_receiver">
...
<test:component>
<test:return-data>error_q</test:return-data>
</test:component>
</flow>
</mule>
Below error shown in Eclipse IDE on line :
Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mule/test/current/mule-test.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
- cvc-complex-type.2.4.a: Invalid content was found starting with element 'test:component'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/
schema/mule/core":response}' is expected.
And getting below error on deploying application to Mule standalone server:
ERROR [24 May 2013 01:59:25,186] [WrapperListener_start_runner] (DispatchingLogger:365) - null
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'test:component'. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-outbound-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor, "http://www.mulesoft.org/schema/mule/core":response}' is expected.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
My bad. There was 2 files with the name test-config.xml and I was doing changes in the wrong one.
When I run this:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://www.mulesource.org/schema/mule/http/2.2"
xmlns:https="http://www.mulesource.org/schema/mule/https/2.2"
xsi:schemaLocation="
http://www.mulesource.org/schema/mule/http/2.2 http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd
http://www.mulesource.org/schema/mule/https/2.2 http://www.mulesource.org/schema/mule/https/2.2/mule-https.xsd
http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd">
<model>
<service name="ConnectToHTTPS">
<inbound>
<http:inbound-endpoint host="localhost"
port="9000"
synchronous="true"/>
</inbound>
<outbound>
<chaining-router>
<outbound-endpoint address="https://localhost"
synchronous="true"/>
</chaining-router>
</outbound>
</service>
</model>
</mule>
I get this:
...
ERROR 2011-07-05 13:06:28,826 [main] org.mule.MuleServer:
********************************************************************************
Message : Failed to invoke lifecycle phase "initialise" on object: HttpsConnector{this=1efe475, started=false, initialised=false, name='connector.https.0', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[https], serviceOverrides=null}
Type : org.mule.api.lifecycle.LifecycleException
Code : MULE_ERROR-70228
JavaDoc : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/lifecycle/LifecycleException.html
********************************************************************************
Exception stack is:
1. The Key password cannot be null (java.lang.IllegalArgumentException)
org.mule.api.security.tls.TlsConfiguration:290 (null)
2. Failed to invoke lifecycle phase "initialise" on object: HttpsConnector{this=1efe475, started=false, initialised=false, name='connector.https.0', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[https], serviceOverrides=null} (org.mule.api.lifecycle.LifecycleException)
org.mule.lifecycle.DefaultLifecyclePhase:277 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/lifecycle/LifecycleException.html)
********************************************************************************
...
You need to explicitly configure the HTTPS connector with a client keystore so you can make outbound HTTPS calls. This is explained here (free registration required to read this doc).
In essence, it boils down to this:
<https:connector name="httpConnector">
<https:tls-client path="clientKeystore" storePassword="mulepassword"/>
</https:connector>