Java 如何将JRebel与Mule ESB集成?

Java 如何将JRebel与Mule ESB集成?,java,mule,esb,jrebel,Java,Mule,Esb,Jrebel,有没有人尝试过将JRebel与Mule结合使用,而不是使用典型的应用服务器?如果是,你能描述一下你的经历吗 据我所知,目前,Mule没有得到JRebel团队的正式支持。但是,我想知道是否有一些解决方法可以解决这个限制。尽管JRebel不正式支持Mule ESB,但我们已经找到了一个解决方法。首先,让我首先说明: 到目前为止,使用JRebel热部署Mule XML流是不可能的。然而,Mule为实现同样的目标提供了自己的机制。因此,缺少JRebel对这一点的支持并不是交易的破坏者 因此,我们唯一

有没有人尝试过将JRebel与Mule结合使用,而不是使用典型的应用服务器?如果是,你能描述一下你的经历吗


据我所知,目前,Mule没有得到JRebel团队的正式支持。但是,我想知道是否有一些解决方法可以解决这个限制。

尽管JRebel不正式支持Mule ESB,但我们已经找到了一个解决方法。首先,让我首先说明:

  • 到目前为止,使用JRebel热部署Mule XML流是不可能的。然而,Mule为实现同样的目标提供了自己的机制。因此,缺少JRebel对这一点的支持并不是交易的破坏者
因此,我们唯一可以热部署的是Java类,它仍然非常受欢迎。我们怎么做

  • 首先在$MULE_HOME/conf/wrapper.conf中配置JRebel代理。在我们的案例中,所需线路为:

    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}
    
这些是启动JRebel和Mule所需的JVM参数。参数的编号是任意的

我们想在远程模式下使用JRebel。您可以在中阅读有关此模式的信息。这就是为什么要使用
wrapper.java.additional.16=-Drebel.remoting\u plugin=true
wrapper.java.additional.19=-Drebel.remoting\u port={which}
参数

  • 现在继续执行Mule.bat或Mule.sh启动Mule,具体取决于您的环境(Windows或*nix)。JRebel应该从它开始
  • 将您的Mule应用程序放在$Mule_HOME/apps中。它们将被自动部署,从现在起,它们的.class文件将由JRebel监控
  • 在IDE中,安装JRebel插件并应用许可证。然后,将JRebel性质添加到项目中,并使用前面在
    wrapper.conf
    中定义的端口配置其远程服务器URL
  • 对代码和同步执行任何需要的更改。它们应该成功地热部署到正在运行的Mule实例中

当我配置所示的点时,我在Mule的控制台中出现了下一个异常:

正在启动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/>
2015-10-27 11:00:27 JRebel:警告您正在支持-agentpath的系统上使用-javaagent选项运行JRebel。
2015-10-27 11:00:29 JRebel:在“文件:/C:/Dev/Mule%20-%2002 esb Mule ee%20-%203.4/conf/Log4j.properties”中监视Log4j配置。
线程“main”java.lang.NoSuchMethodError中出现异常:javax.xml.parsers.SecuritySupport$1:method()V未找到
位于javax.xml.parsers.SecuritySupport.getContextClassLoader(未知源)
位于javax.xml.parsers.FactoryFinder.find(未知源)
位于javax.xml.parsers.DocumentBuilderFactory.newInstance(未知源)
位于com.opensymphony.module.propertyset.config.PropertySetConfig.(PropertySetConfig.java:53)
位于com.opensymphony.module.propertyset.config.PropertySetConfig.getConfig(PropertySetConfig.java:113)
位于com.opensymphony.module.propertyset.PropertySetManager.getInstance(PropertySetManager.java:32)
位于com.opensymphony.module.propertyset.PropertySetManager.getInstance(PropertySetManager.java:22)
位于com.mulesource.licm.pref.MulePropertySetPreferences.loadPropertySet(MulePropertySetPreferences.java:208)
位于com.mulesource.licm.pref.MulePropertySetPreferences.(MulePropertySetPreferences.java:50)
位于com.mulesource.licm.pref.MulePreferencesFactory.(MulePreferencesFactory.java:19)
在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
位于sun.reflect.NativeConstructorAccessorImpl.newInstance(未知源)
在sun.reflect.delegatingConstructor或AccessorImpl.newInstance(未知源)
位于java.lang.reflect.Constructor.newInstance(未知源)
位于java.lang.Class.newInstance(未知源)
位于java.util.prefs.Preferences.factoryOrig(未知源)
位于java.util.prefs.Preferences.userRoot(未知源)
在com.mulesource.licm.impl.TrueLicenseHelper.createLicenseManagerParameters(TrueLicenseHelper.java:338)
位于com.mulesource.licm.impl.TrueLicenseHelper.createLicenseManagerParameters(TrueLicenseHelper.java:330)
位于com.mulesource.licm.impl.TrueLicenseHelper.(TrueLicenseHelper.java:120)
在com.mulesource.licm.impl.mulelicensemanger.(mulelicensemanger.java:25)
在com.mulesource.licm.LicenseManagementFactory.createLicenseManager(LicenseManagementFactory.java:48)上
位于org.mule.module.boot.LicenseKeyHandler.(LicenseKeyHandler.java:43)
在org.mule.module.reboot.MuleContainerBootstrap.handleLicenseKey(MuleContainerBootstrap.java:192)上
位于org.mule.module.reboot.MuleContainerBootstrap.main(MuleContainerBootstrap.java:62)

在测试时,我注意到您需要在文件wrapper.conf中添加下一个属性:

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

有了这些,JRebel可以正常运行。总之,当我们使用特定端口时,启用JRebel的日志记录是必要的
更多信息,请查看步骤6:

Mule中的JRebel配置非常类似于

您需要在
$MULE\u HOME/conf/wrapper.conf
中添加JRebel代理作为
wrapper.java.additional.
属性:

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

如果使用Java版本7及更新版本,则使用代理:

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

如果使用Java版本6及以下版本,则需要使用jrebel.jar文件。

-配置不需要提供一些JVM参数。首先是JVM参数“wrapper.java.additional.15=-