mule Posts

[Mule] Error 400 Bad Request, Request Header Or Cookie Too Large

I had an error yersterday, when connecting Mule ESB to NGinx. Very weird, because somehow it never shown any errors when fired directly without a reverse proxy. Here is the complete stacktrace

<head><title>400 Request Header Or Cookie Too Large</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>Request Header Or Cookie Too Large</center>
<hr><center>nginx/1.4.4</center>
</body>
</html>
 (javax.xml.ws.soap.SOAPFaultException)
  org.apache.cxf.jaxws.JaxWsClientProxy:156 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/ws/soap/SOAPFaultException.html)
3. Response was of unexpected text/html ContentType.  Incoming portion of HTML stream: <html>
<head><title>400 Request Header Or Cookie Too Large</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>Request Header Or Cookie Too Large</center>
<hr><center>nginx/1.4.4</center>
</body>
</html>

It happens because Mule, by default, send a very large cookies called “X-MULE_SESSION”. After removing it, my ESB runs well again. This is how i remove it,

<http:connector name="NoSessionConnector">
	    <service-overrides sessionHandler="org.mule.session.NullSessionHandler"/>
</http:connector>
Google+

How to Handle Error on Mule, “Flow exception listener contains and exception strategy that doesn’t handle all request”

Today i had a very weird error on Mule ESB, that somehow never happened to my other colleague. This is the complete stacktrace,

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Failed to deploy artifact 'edw-soa', see below              +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
org.mule.module.launcher.DeploymentInitException: FlowConstructInvalidException: Flow exception listener 
contains and exception strategy that doesn't handle all request, Perhaps there's an exception strategy 
with a when attribute set but it's not part of a catch exception strategy
	at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:196) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.artifact.ArtifactWrapper$2.execute(ArtifactWrapper.java:62) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:129) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.artifact.ArtifactWrapper.init(ArtifactWrapper.java:57) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:25) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DefaultArchiveDeployer.guardedDeploy(DefaultArchiveDeployer.java:310) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:330) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:155) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:256) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:78) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:100) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:152) ~[mule-module-launcher-3.6.1.jar:3.6.1]
	at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:15) ~[tooling-support-3.6.1.jar:?]

Basically, it happen because of MuleESB backward incompatibility. And after adding these line, the error seems to go away (forever hopefully :D )

<catch-exception-strategy doc:name="Catch Exception Strategy">
	<logger level="ERROR" message="[Exception thrown]" />
	<set-payload
		value="#[com.edw.soa.process.Utils.responseProcess(originalPayload,'Transaksi gagal','1')]" />
</catch-exception-strategy>

Thank you to Muhammad Reza Nurhakim and Adhi Wicaksono for solving this.

Google+

Creating A Simple HTTP GET Request Using Mule ESB

It is the first time im using Mule ESB, so im trying to create a simple tutorial using it.

In this tutorial, im trying to do a simple GET request. But first, a simple POST request for comparation.

<expression-component doc:name="Expression"> 
	<![CDATA[
	sendFields = new java.util.HashMap();
	sendFields['aaa']='1';
	sendFields['bbb']='2';
	
	payload = sendFields;]]>
</expression-component>
<http:outbound-endpoint exchange-pattern="request-response" 
			method="POST"
			address="http://192.168.0.1/" 
			contentType="application/x-www-form-urlencoded"
			doc:name="HTTP" />

Looks very simple, create a simple hashmap, send it through http outbond using POST method.
While this is my code for GET method

<http:outbound-endpoint exchange-pattern="request-response" 
			method="GET"
			connector-ref="NoSessionConnector" 
			address="http://192.168.0.1/?aaa=1&amp;bbb=2"
			contentType="text/html" 
			doc:name="HTTP" />

So instead of pushing my parameters via hashmaps, i add them directly on my url.

Google+