October 17, 2007

Testing JavaRebel

Filed under: blog — Jevgeni Kabanov @ 10:25 pm

Quite a few of our users have contributed small pieces of code that test reloading of some parts of Java classes. Some of them have discovered genuine bugs and we are working on fixing them. However there was also some confusion that we want to clear up.

If you want to write a small test for JavaRebel you have to be aware of the two following things:

  • JavaRebel will not reload code of currently running method. All new invocations of the method (even concurrent ones) will get reloaded, but the code in a running method will not reload. This means that if you have a method with while (true) {/*body*/} the body will never reload since you never leave the method. This is not a restriction in any real application, but this does show up in the small tests.
  • The second issue is more particular to JavaRebel — if all running methods are of the same class they might not get reloaded (this does not always apply, but may compromise your test). This issue may come if you have only one class (e.g. Main) and try to change a method inside the same class.

The recommended way to test JavaRebel is to make a separate Launcher class with a while loop and call a method test() in another class (e.g. Test) with it. If you want to test concurrency make a separate class for threads (inner or anonymous will be enough).

October 10, 2007

JavaRebel for Open Source Development

Filed under: blog,news — Tags: — Toomas Römer @ 5:14 pm

Although JavaRebel is a commercial product we do support the open source movement by providing free licenses of JavaRebel to qualified Open-Source projects (as you may know we’re developing the open source Aranea Web Application Platform ourselves).

To request a personal OSS license please e-mail support@zeroturnaround.com with the following information

  • Project name
  • Developer name and e-mail
  • Proof of association (link to a page or mailing list associating the developer with the project). This is not needed if the e-mail belongs to the project.

To request a committer license for all project committers a project leader or representative should contact us.

October 8, 2007

JavaRebel Brings Class Reloading to Java

Filed under: blog — Jevgeni Kabanov @ 9:28 pm

JavaRebel reloads changes to Java classes on-the-fly without redeploy or restart including new methods and fields. It is a generic solution that works for standalone Java applications as well as application servers. For the impatient: watch the demonstration screencast (~5 mins) and download!

Ever since HotSwap support has been introduced in Java 1.4 people have been craving for more. As witnessed by this bug in the Sun database and numerous other discussions changing method bodies was just not enough. Dynamic languages like Ruby were quick enough to capitalize on this lacking touting Java EE development as slow and cumbersome.

As time passed by people have tried to work around the limitation by reloading classes along with their classloader. However since this requires also to reconstruct the object state it will only work in a controlled and limited environment — e.g. that of a web framework like RIFE, Tapestry 5 and so on.

Just as many others we were working on a workaround. However instead of limiting ourselves to the facilities provided by the Java platform we devised a whole new approach. Using bytecode modification and a little bit of magic JavaRebel extends the JVM with ability to reload almost arbitrary changes to classes on-the-fly. This includes adding and removing both methods and fields and the only forbidden changes are to ‘extends’ and ‘implements’ clauses. Since all the existing object instances are preserved the application and server can continue running and code changes are immediately visible in the application.

Watch the demonstration screencast (~5 mins), read the feature list or just download JavaRebel from ZeroTurnaround.com and give it a try. Disclaimer: JavaRebel is commercial software with a free trial for 14 days and developer seat cost at 99$.

ZeroTurnaround is a spinoff of Webmedia, Ltd. that focuses on Java developer productivity tools. Currently we are developing JavaRebel, a generic Java class reloader, and JSP Weaver, an instant JSP interpreter.

October 2, 2007

JavaRebel 1.0 M2 Released

Filed under: news — Jevgeni Kabanov @ 9:06 pm

This release includes numerous improvements in features, compatibility and stability.

Thanks to all of the beta testers we managed to collect and fix a lot of issues and thus make the open beta possible. We now support six different application containers (not counting the versions) and two JVMs (Sun HotSpot and Bea JRockit). Of course these features are mostly transparent to the end-user as JavaRebel will just reload more changes in more environments, but that makes it all the more valuable.

Our Customers Say

“For the price, and for how easy it is to get installed and running in a developers’ environment, using JRebel is pretty close to a no-brainer.”

Jim Lesko, GT Nexus

Recent Tweets

RT @nilsga: Top three productivity changes in current project: 1. Use javarebel, 2. Switch to Linux, 3. Two monitors 1 week ago

RT @GabrielKast: java is optional but JRebel is mandatory. Luckily it's only 59$ per year ... Three month of of World of Warcraft! 1 week ago

Olark Livehelp