How to Install and Use JRebel with WebLogic and Eclipse

187 篇文章 0 订阅
http://zeroturnaround.com/blog/how-to-install-and-use-jrebel-with-weblogic-and-eclipse/

In a recently conducted survey (with 1100+ respondents),  WebLogic users estimated spending approximately 21% of all their coding time on the redeployment process.  To extrapolate a bit, that’s ~13 minutes per hour of coding, adding up to ~256 hours or 6.4 full work weeks annually.  JRebel reduces this time by 80%, so it’s worth taking a few minutes to try it out.  In this tutorial we explain how to install and use it step-by-step.

First, take a quick look at how coding looks when using JRebel (formerly JavaRebel).

This tutorial assumes that you are using Eclipse 3.x (with Oracle Enterprise Pack for Eclipse installed) with WebLogic 9.x or later. Most of the steps will be applicable to other versions as well, but it may look different from the screenshots included.

Contents:

STEP 1: Install JRebel

The latest stable version of JRebel can be downloaded here. Unpack it to a directory of your choice.

2009-07-03_124429

STEP 2: Installing JRebel Eclipse IDE plugin

The JRebel Eclipse IDE plugin was introduced with JRebel 2.0 and makes configuring and using JRebel considerably easier. You can install the plugin by going to Help » Software updates » Available software » Add site and use the http://www.zeroturnaround.com/update-site/ URL as the update site.

2009-07-15_142449

STEP 3: Make a rebel.xml for your application

In order to do it’s magic, JRebel needs to know where your classes and resources are. We’ll use a rebel.xml configuration file to tell it. This is mandatory when you deploy your app as a WAR/EAR. You’ll need to have one rebel.xml file per module. This includes both web and EJB modules. The rebel.xml configuration file should be placed in your WEB-INF/classes directory in the case of a web module and in the jar root in the case of an ejb module. Put it in the root of a source or resource folder in your project (the same place where the .properties files are).

If you use Maven you can use the JRebel Maven plugin that will generate the rebel.xml in accordance with the module pom.xml as described in the Maven Plugin configuration manual.

In 99% of cases, people tend to use one module per project. In these cases, the JRebel Eclipse IDE plugin can generate the rebel.xml file for you, on a per project basis. If your project is one of the exceptions, edit the file manually as described in the Installation manual, otherwise generate the rebel.xml like this:

Click on your project and pick Generate rebel.xml

2009-07-15_143501

STEP 4: Configuring the Eclipse WTP IDE

You may skip this step if you run Weblogic outside of the Eclipse IDE.

Open the Servers View and double click the BEA WebLogic Server that your application is deployed to (if you don’t see the Servers View go to Window » Show View » Servers).

Eclipse Weblogic Server

Open Publishing and choose Never publish automatically.

2009-07-15_144654

It may seem wrong to disable automatic publishing, but as JRebel will take care of updates from now on, it would just slow you down.

Open JRebel Integration and check Enable JRebel agent.

2009-07-15_145028

NB! With the current version of the Eclipse JRebel plugin checking the checkbox does NOT WORK. See the workaround in the next step.

STEP 4a: Configuring the Eclipse WTP IDE workaround

Until we update our JRebel Eclipse plugin you have to manually enable JRebel for the Weblogic Server. You would need to manually edit the startup script of the server. Luckily it is quite easy and the startup script can be opened for editing from the server view from the last step.

Eclipse Weblogic edit server startup-script

A text file will open. You will need to copy the following line as the first line of the file

set JAVA_OPTIONS=-noverify -javaagent:C:\javarebel.jar %JAVA_OPTIONS%

set JAVA_OPTIONS=-noverify -javaagent:C:\javarebel.jar %JAVA_OPTIONS%

Make sure to change the C:\javarebel.jar to the correct location.

STEP 5: Configuring Eclipse IDE

Go to Window » Preferences and from there to Java » Debug » Step Filtering. Check Use Step Filters and Filter synthetic methodsand Step through filters. Now check all the default filters and use the Add Filter button to add com.zeroturnaround.* andorg.zeroturnaround.*.

2009-07-03_143321

Now go to Project » Build automatically and make sure it is checked.

2009-07-03_144612

STEP 6: Success!

To check that the installation was successful access a page that uses a class, change that class in the IDE, press Save, access the page again and look for the following message in the console:

Eclipse Weblogic Success

Now that you’re up and running, it’s time to enjoy coding without the need to redeploy. If you have any specific questions JRebel, the Forum is the best place to ask, so that other people get to hear the answer as well. Otherwise, you can contact us at support@zeroturnaround.com.

If you like what you see, please give us a quick mention on your blog or twitter (you can even follow ushere).

Have a great day!

Find out more:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值