簡體   English   中英

如何將JRebel與Mule ESB集成?

[英]How to integrate JRebel with Mule ESB?

是否有人試圖將JRebel與Mule一起使用而不是典型的應用服務器? 如果是這樣,你能描述一下你的經歷嗎?

據我所知,目前,Mule並沒有得到JRebel團隊的正式支持。 但是,我想知道是否可能有一些解決方法來解決這個問題。

雖然JRebel沒有正式支持Mule ESB,但我們找到了一種解決方法。 首先,讓我首先說明:

  • 截至今天,這是不可能的熱部署騾子XML使用JRebel的流動。 然而,騾子提供了自己的機制來實現同樣的事情。 因此,缺乏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} 

這些是與Mule一起啟動JRebel所需的JVM參數。 參數的編號是任意的。

我們想在遠程模式下使用JRebel。 您可以在文檔中閱讀有關此模式的信息。 這就是wrapper.java.additional.16=-Drebel.remoting_plugin=truewrapper.java.additional.19=-Drebel.remoting_port={whatever}參數的原因。

  • 現在繼續執行mule.bat或mule.sh,啟動Mule,具體取決於您的環境(Windows或* nix)。 JRebel應該從它開始。
  • 將您的Mule應用程序放在$ MULE_HOME / apps中。 它們將自動部署,從現在開始,它們的.class文件將由JRebel監視。
  • 在IDE中,安裝JRebel插件並應用許可證。 然后,將JRebel特性添加到項目中,並使用我們之前在wrapper.conf定義的端口配置其遠程服務器URL。
  • 對您的代碼和同步做任何需要做的更改。 它們應該成功熱部署到正在運行的Mule實例中。


當我測試時,我注意到你需要在文件wrapper.conf中添加下一個屬性:

wrapper.java.additional.18 = -Drebel.log =真
wrapper.java.additional.19 = -Drebel.log.file = / mypath中/ LogName.log

有了這些,JRebel就能正常運行。 總之,當我們使用特定端口時,必須啟用JRebel的日志記錄。
更多信息,請檢查第6步:
https://zeroturnaround.com/software/jrebel/learn/remoting/setting-up-jrebel-remoting-with-intellij-idea-and-tomcat/

當我配置了指示的點時,我在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/>

Mule中的配置JRebel與tc Server中的配置非常相似。

您需要在$MULE_HOME/conf/wrapper.conf添加JRebel代理作為wrapper.java.additional.*屬性:

wrapper.java.additional.10 = -agentpath:[C:\\路徑\\至] 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文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM