Latest news

JavaRebel 1.1.2 Released

An incremental update to the stable branch of JavaRebel....

Get a free JavaRebel license

We will give away 50 personal JavaRebel licenses to those who register first. Also personal licenses will be discounted to $49 unt...

JavaRebel offers free licenses to JavaBlackBelt brown belts

JavaRebel offers permanent licenses to all JavaBlackBelt's brown belts. This is a personal 1 seat commercial license that you can ...

Archive for March, 2008

JSP Weaver 1.0.2 released

Monday, March 31st, 2008

This is a small bug-fix release of JSP Weaver. All the issues that have been reported have been fixed and some performance optimizations from the development snapshots have also been included. See the changelog for more information:

  • New error screen with source display
  • Updated Commons EL to ZeroTurnaround patched version
  • General performance improvements
  • Fixed issue with boolean tag attributes
  • Fixed issue with c:foreach tag
  • Fixed issue with containers using servlet output stream in included pages
  • Fixed issue with scriptlets ordering in JSP XML format
  • Fixed issue with imports and declared methods in statically included pages
  • Fixed issue with resource paths not ending with slash

Head off to the download section to get the latest version.

Integrating JavaRebel with Spring

Wednesday, March 12th, 2008

We have started working on integrating JavaRebel with the Spring Framework. First we are concentrating on annotation based configuration and then see what can we do with changes in the XML configuration files.

JavaRebel detects added/removed/changed annotations so reloading the changes is a matter of finding the right spots in the code that test for existence of certain classes and their annotations. The simplest solution on failure is to just refresh the context and try one more time. If it fails anyway the extra time relooking is not expensive.

Lets take an example. We are using the Petclinic sample that comes with Spring. Lets add a new controller.

package org.springframework.samples.petclinic.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class NewController {
    public NewController() {}

    @RequestMapping(“/newWelcome.do”)
    public void welcomeHandler() {}
}

And create a newWelcome.jsp also. Lets try to visit the url petClinic/newWelcome.do now. Of course we get an 404. Lets look at the code in DispatcherServlet that looks for the mappings.

Iterator it = this.handlerMappings.iterator();
while (it.hasNext()) {
   // looking for the handler
   …..
   return handler;
}
return null;

Lets make this code refresh the application context if null is returned and after the refresh try one more time.

if (AbstractRefreshableApplicationContext.class.isAssignableFrom(getWebApplicationContext().getClass())) {
 ((AbstractRefreshableApplicationContext)getWebApplicationContext()).refresh();
 // look for the handler again
 // …
}

What does it give us? Adding/changing new controllers is a matter of refreshing the context. Basically all integrations boil down to reiniting some internal state to take into account the changes.

On error we are falling back to give it one more try. Actually this example will find the newly added controller without JavaRebel because the refresh of the context will scan for the new class files. Of course all the other adding/changing/removing classes/methods/annotations etc. will need on-the-fly class reloading.

The status of integrating JavaRebel with different projects can be seen from our Google Code page. If you need help with your own integration just use the forum or drop us a line at support email.

JavaRebel 1.1-M2 Released

Monday, March 10th, 2008

The second milestone of the 1.1 release is available for download!

The changes include improved support for dynamic proxies (JDK, CGLib and Javassist variaties), better classloading behaviour, better debugging experience and more. Also the JavaRebel log (enabled by adding “-Drebel.log=true” to the JVM command line) is no longer encrypted, providing you with much better feedback on JavaRebel’s behaviour.

The next release will focus on integration with frameworks (Spring being the most important), improved SDK and JAR reloading support. We expect to release 1.1 GA in mid-April.

ZeroTurnaround team blog at dow.ngra.de

Thursday, March 6th, 2008

Since in the past there were some misunderstandings between what are the official announces of ZeroTurnaround and what is the team personal opinion we decided to use this site for official announces and articles only. However same members of our team that entertained you here have for some time been writing at dow.ngra.de. This is their personal blog which does not in any way represent the policy or opinions of our company.

Configuring IDE Debugging with JavaRebel

Tuesday, March 4th, 2008

One of the inconveniences that our users frequently report is stepping in/out of the code managed by JavaRebel. However we have found that most IDEs today provide a way to filter out JavaRebel methods and in this article we will show how to configure Eclipse and IDEA to make your debugging as pleasant as ever.

To configure Eclipse go to Window -> Preferences and from there to Java -> Debug -> Step Filtering (or just search for “Step filtering”). Enable step filters and “Filter synthetic methods”. Make sure that “Step through filters” is also on. Now enable all the default filters and add three package ones:

  • RebelMethodAccessor*
  • com.zeroturnaround.*
  • org.zeroturnaround.*

Result should look like this:

In IntelliJ Idea open up debugger properties (File - Settings - Debugger). On the lower left corner of the debugger settings page make the necessary changes. Be sure to tick “Skip synthetic methods” checkbox and add the necessary class filters. See screenshot:

ZT patched Commons-EL - lookup newly added properties

Tuesday, March 4th, 2008

Commons-EL is a widely used JSP 2.0 Expression Language Interpreter from Apache. It lets you easily access and manipulate application data in JSP files without requiring the use of scriptlets. Of course commons-el has caching mechanism in place so that newly added/changed fields are not visible in the EL until application redeploy. We have released a small patch and a custom build of the commons-el that lets you access the newly added/changed fields without the limitations. Hopefully this patch will be accepted to the unplanned commons-el 1.1 version.