How to integrate JRebel with Mule ESB?

Has anyone ever tried using JRebel with Mule instead of a regular application server? If so, could you describe your experience?

As far as I know, Mule is currently not officially supported by the JRebel team. However, I was wondering if there could be some workaround for this limitation.

+6
source share
4 answers

Although Mule ESB is not officially supported by JRebel, we found a workaround. First of all, let me start by saying that:

  • Today, there is a possibility not for the hot deployment of Mule XML streams using JRebel. However, Mule offers his own mechanisms to achieve the same goal. Thus, the lack of JRebel support for this is not a transaction violator.

So, the only thing we can deploy are the Java classes, which are still very welcome. How do we do this?

  • Start by setting up the JRebel agent in $ MULE_HOME / conf / wrapper.conf. In our case, the required lines were:

    wrapper.java.additional.13=-javaagent:{path to jrebel.jar} wrapper.java.additional.14=-Xbootclasspath:{path to rebelboot.jar} wrapper.java.additional.16=-Drebel.remoting_plugin=true wrapper.java.additional.19=-Drebel.remoting_port={whatever} 

These are the JVM parameters needed to run JRebel with Mule. Parameter numbering is arbitrary.

We want to use JRebel remotely. You can read about this mode in docs . This is the reason for the wrapper.java.additional.16 wrapper.java.additional.16=-Drebel.remoting_plugin=true and wrapper.java.additional.19=-Drebel.remoting_port={whatever} .

  • Now start Mule by executing mule.bat or mule.sh, depending on your environment (Windows or * nix). JRebel should start with this.
  • Put your Mule apps in $ MULE_HOME / apps. They will be automatically deployed, and henceforth their .class files will be controlled by JRebel.
  • Inside your IDE, install the JRebel plugin and apply your license. Then add the nature of JRebel to your project and configure the remote server URL using the port we previously defined inside wrapper.conf .
  • Make all the changes you need to make for your code and synchronization. They must be successfully deployed to the current instance of Mule.
+4
source


when I tested, I noticed that you need to add the following attributes to the wrapper.conf file:

wrapper.java.additional.18 = -Drebel.log = true
wrapper.java.additional.19 = -Drebel.log.file = / MyPath / LogName.log

JRebel works correctly with them. In conclusion, when we use a specific port, we need to enable JRebels.
Further information, check in step 6:
https://zeroturnaround.com/software/jrebel/learn/remoting/setting-up-jrebel-remoting-with-intellij-idea-and-tomcat/

+2
source

When I am configured with the indicated points, I have the following exception in the Mule console:

Running JVM ...

 2015-10-27 11:00:27 JRebel: WARN You are running JRebel using the -javaagent option on a system where -agentpath is supported.<br/> 2015-10-27 11:00:29 JRebel: Monitoring Log4j configuration in 'file:/C:/Dev/Mule%20-%2002-esb-mule-ee%20-%203.4/conf/log4j.properties'.<br/> Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.parsers.SecuritySupport$1: method <init>()V not found<br/> at javax.xml.parsers.SecuritySupport.getContextClassLoader(Unknown Source)<br/> at javax.xml.parsers.FactoryFinder.find(Unknown Source)<br/> at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)<br/> at com.opensymphony.module.propertyset.config.PropertySetConfig.<init>(PropertySetConfig.java:53)<br/> at com.opensymphony.module.propertyset.config.PropertySetConfig.getConfig(PropertySetConfig.java:113)<br/> at com.opensymphony.module.propertyset.PropertySetManager.getInstance(PropertySetManager.java:32)<br/> at com.opensymphony.module.propertyset.PropertySetManager.getInstance(PropertySetManager.java:22)<br/> at com.mulesource.licm.pref.MulePropertySetPreferences.loadPropertySet(MulePropertySetPreferences.java:208)<br/> at com.mulesource.licm.pref.MulePropertySetPreferences.<clinit>(MulePropertySetPreferences.java:50)<br/> at com.mulesource.licm.pref.MulePreferencesFactory.<clinit>(MulePreferencesFactory.java:19)<br/> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br/> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)<br/> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)<br/> at java.lang.reflect.Constructor.newInstance(Unknown Source)<br/> at java.lang.Class.newInstance(Unknown Source)<br/> at java.util.prefs.Preferences.factoryOrig(Unknown Source)<br/> at java.util.prefs.Preferences.userRoot(Unknown Source)<br/> at com.mulesource.licm.impl.TrueLicenseHelper.createLicenseManagerParameters (TrueLicenseHelper.java:338)<br/> at com.mulesource.licm.impl.TrueLicenseHelper.createLicenseManagerParameters(TrueLicenseHelper.java:330)<br/> at com.mulesource.licm.impl.TrueLicenseHelper.<init>(TrueLicenseHelper.java:120)<br/> at com.mulesource.licm.impl.MuleLicenseManager.<init>(MuleLicenseManager.java:25)<br/> at com.mulesource.licm.LicenseManagementFactory.createLicenseManager(LicenseManagementFactory.java:48)<br/> at org.mule.module.boot.LicenseKeyHandler.<init>(LicenseKeyHandler.java:43)<br/> at org.mule.module.reboot.MuleContainerBootstrap.handleLicenseKey(MuleContainerBootstrap.java:192)<br/> at org.mule.module.reboot.MuleContainerBootstrap.main(MuleContainerBootstrap.java:62)<br/> 
+1
source

The configuration of JRebel in Mule is very similar to the configuration on the tc server .

You need to add the JRebel Agent as a property of wrapper.java.additional.* $MULE_HOME/conf/wrapper.conf :

wrapper.java.additional.10 = -agentpath: [C: \ path \ to] Lib \ jrebel64.dll

If you are using Java version 7 or later, you are using the agent:

 Windows 64-bit JDK jrebel64.dll Windows 32-bit JDK jrebel32.dll Mac OS X 64-bit JDK libjrebel64.dylib Mac OS X 32-bit JDK libjrebel32.dylib Linux 64-bit JDK libjrebel64.so Linux 32-bit JDK libjrebel32.so 

If you are using Java version 6 or lower, you need to use the deprecated jrebel.jar agent .

0
source

All Articles