May 2017
« Sep    
Your widget title

Posts Tagged ‘Mule ESB’

PostHeaderIcon How to access global variables in Mule 3?


In Mule 2.2.1, getting the global variables was allowed. Therefore, such a block worked:

 <add-message-property key="jonathanProperty"
 value="#1" />

In Mule 3, this is no more possible. Therefore, how to access -former- global variables within a Mule 3 config file?


Access the global variables owing to their scope, such as Invocation, Inbound, Outbound, Session, thanks to the methods MuleMessage.get<Scope>Property(), eg:

<add-message-property key="jonathanProperty"
 value="#1" />

PostHeaderIcon Filter too large files in Mule ESB


You use a filter connector in Mule ESB 2.2.1, to perform any operation (let’s say: to send them on JMS, but this does not matter). You would like to filter files owing to their size, ie stop the handling of files larger than 10,000,000 bytes for instance.

We assume the files you handle are text files (not binary).


In your Mule XML config file, add the following block, using a short Groovy script:

<message-properties-transformer name="add-properties">
     <add-message-property key="fileSizeOK"
             value="#1" />

In the tag <file:inbound-endpoint>, add the attribute: transformer-refs="add-properties"
Now, add a tag <message-property-filter pattern="fileSizeOK=true"/>. Your outbound should then be similar to:

                    <jms:outbound-endpoint queue="lalou.jonathan.jms.queue"
                    <message-property-filter pattern="fileSizeOK=true"/>
                    <file:outbound-endpoint path="/my/folder/"
                        connector-ref="fileConnector" outputPattern="error/#[header:originalFilename].too_big.#[function:dateStamp:yyyyMMdd_HHmmss_SSSSS].KO" />

Many thanks to Vincent N. for his help.

PostHeaderIcon Tutorial: Re-package Mule ESB as a standalone client


You have to deliver Mule 2.2.1 as a standalone application, or, more accurately, as a simple archive ready-to-use by someone else (customer, co-team worker, etc.).

In this tutorial, we assume that:

  • you have to include external jars, eg. MQ and WebLogic jars
  • you have written your XML configuration file for Mule, of which all properties are externalized in an external property file. We don’t mind the actual workflow, we assume you’re skilled enough with Mule 😉



Prior to building standalone:

  • get Mule ESB 2.2.1 standalone archive, available on MuleSoft website
  • get the JARs needed by MQ
    • providerutil.jar
    • fscontext.jar
    • dhbcore.jar
    • connector.jar
    • commonservices.jar
  • get WebLogic’s wlfullclient.jar
  • install the zip and the jars on your local repository:
    mvn install:install-file -DgroupId=org.mulesource -DartifactId=mule-esb -Dversion=2.2.1 -Dpackaging=zip
    mvn install:install-file -Dfile=wlfullclient.jar  -DgroupId=weblogic -DartifactId=wlfullclient -Dversion=10.3 -Dpackaging=jar -DgeneratePom=true
    mvn install:install-file -Dfile=fscontext.jar  -DgroupId=fscontext -DartifactId=fscontext -Dversion=1.2 -Dpackaging=jar -DgeneratePom=true
    mvn install:install-file -Dfile=providerutil.jar  -DgroupId=fscontext -DartifactId=providerutil -Dversion=1.2 -Dpackaging=jar -DgeneratePom=true
    mvn install:install-file -DgroupId=mq -Dversion= -Dpackaging=jar
    mvn install:install-file -DgroupId=mq -Dversion= -Dpackaging=jar
    mvn install:install-file -DgroupId=mq -DartifactId=dhbcore -Dversion= -Dpackaging=jar -Dfile=dhbcore.jar
    mvn install:install-file -DgroupId=mq -DartifactId=commonservices -Dversion= -Dpackaging=jar -Dfile=commonservices.jar
    mvn install:install-file -DgroupId=connector -DartifactId=connector -Dversion=1.0 -Dpackaging=jar -Dfile=connector.jar

Files to be edited

  • Create a mule-jonathan.xml file in src/main/resources/ folder.
  • Externalize all properties in file in src/main/resources/ folder. As you may anticipate it, you will have add this property file in Mule classpath
  • To perform that:
    • Copy the wrapper.conf of Mule standalone archive as src/main/resources/wrapper.conf
    • After the line:*.jar

      , add the line:
  • in src/main/resources/, create a file start-mule-jonathan.bat, with the content:
    set MULE_HOME=%CD%
    cd %MULE_HOME%\bin
    mule.bat -config mule-jonathan.xml


Here is the pom.xml of our project:

<?xml version="1.0"?>
<project xmlns="" xmlns:xsi=""  xsi:schemaLocation="">

Maven Assembly

We will use Maven Assembly: this plugin allows unpack archives, copy files, insert files, delete folders, etc.

Here is the assembly.xml file that should be located in src/main/assembly/ folder of your project. The code is commented so that you understand what we do.

<assembly xmlns=""           xmlns:xsi=""           xsi:schemaLocation="                     ">
          <!-- excluse original wrapper.conf, to include our tuned wrapper.conf-->
          <!--remove the these folders, useless in a standalone client-->
        <!--include the property file -->
        <!-- include Mule XML config file-->
        <!-- modified wrapper.conf to stake in account the etc/ folder, containing the property file-->

Build process

To build go to the folder yourproject/jonathan, then launch a mvn clean install. A complete installation package is output on target folder:

The archive is built thanks to Maven Assembly plugin.



Copy or move the archive to any folder of your choice. Then unzip it.

(optionnal) Checks


Here is a tree of the installation, with some important file that must appear:

¦   +---mule-jonathan.xml
¦   +---wrapper.conf
¦   +---boot
¦   ¦   +---exec
¦   +---endorsed
¦   +---mule
¦   +---opt
¦   +---user
¦       +------commonservices-
¦       +------connector-1.0.jar
¦       +------dhbcore-
¦       +------fscontext-1.2.jar
¦       +------providerutil-1.2.jar
¦       +------wlfullclient-10.3.jar
¦       +------connector-1.0.jar


Check the files listed above in the tree appear. Besides, check the conf/wrapper.conf file contains the line


Edit etc/ file and set the right properties.


Execute start-mule-jonathan.bat to launch Mule on Windows. On first attempt, Mule will display the user licence and ask you your confirmation you accept the terms of the agreement.

PostHeaderIcon Mule / MQJE001 / MQJMS2007


In a Mule ESB workflow, the endpoint is a <jms:outbound-endpoint>, pointing to a JMS queue hosted on MQ Series and accessed through WebLogic 10.3.3.

I get the following stracktrace

Exception stack is:
1. MQJE001: Completion Code 2, Reason 2027 ( (null)
2. MQJMS2007: failed to send message to MQ queue(JMS Code: MQJMS2007) (javax.jms.JMSException) (
3. Failed to create and dispatch response event over Jms destination "queue://MQSERVER/AMQ.4C8A5E112285475605?persistence=1". Failed to route event via endpoint: null. Message payload is of type: JMSObjectMessage (org.mule.api.transport.DispatchException)
org.mule.transport.jms.JmsReplyToHandler:154 (


On Mule config file, explicitly set the attribute disableTemporaryReplyToDestinations at true in the JMS outbound tag:

 transformer-refs="foo" disableTemporaryReplyToDestinations="true"/>

PostHeaderIcon Mule / MQJMS3000: failed to create a temporary queue from SYSTEM.DEFAULT.MODEL.QUEUE


I have a Mule workflow, of which outbound is a <jms:outbound-endpoint>. The destination queue is hosted on MQ Series and accessed through WebLogic 10.3.3 bridge.

I get the following error:

MQJMS3000: failed to create a temporary queue from SYSTEM.DEFAULT.MODEL.QUEUE

Complete Stacktrace

2010-11-03 13:03:11,421 ERROR mule.DefaultExceptionStrategy       - Caught exception in Exception Strategy: MQJMS3000: failed to create a temporary queue from SYSTEM.DEFAULT.MODEL.QUEUE
javax.jms.JMSException: MQJMS3000: failed to create a temporary queue from SYSTEM.DEFAULT.MODEL.QUEUE
 at org.mule.transport.jms.Jms11Support.createTemporaryDestination(
 at org.mule.transport.jms.JmsMessageDispatcher.getReplyToDestination(
 at org.mule.transport.jms.JmsMessageDispatcher.dispatchMessage(
 at org.mule.transport.jms.JmsMessageDispatcher.doDispatch(
 at org.mule.transport.AbstractMessageDispatcher$


A similar issue is described here on Mule support forum. Richard Swart wrote:

This not really mule specific error but an MQ authorization error. The QueueSession.createTemporaryQueue method needs access to the model queue that is defined in the QueueConnectionFactory temporaryModel field (by default this is SYSTEM.DEFAULT.MODEL.QUEUE).

Quick Fix

To fix the issue: on MQ server side, grant visibility to client applications on the default SYSTEM.DEFAULT.MODEL.QUEUE