659770 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 59 Messages: 59 Messages: 59 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

JavaRebel Brings Class Reloading to Java

Posted by: Jevgeni Kabanov on October 09, 2007 DIGG
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 lack, 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 reconstruction of 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 the 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$.

Threaded replies

·  JavaRebel Brings Class Reloading to Java by Jevgeni Kabanov on Tue Oct 09 09:15:20 EDT 2007
  ·  Re: JavaRebel Brings Class Reloading to Java by Dennis Bekkering on Tue Oct 09 10:39:34 EDT 2007
    ·  Re: JavaRebel Brings Class Reloading to Java by Jevgeni Kabanov on Tue Oct 09 10:41:19 EDT 2007
      ·  Re: JavaRebel Brings Class Reloading to Java by Dennis Bekkering on Tue Oct 09 11:00:53 EDT 2007
        ·  Re: JavaRebel Brings Class Reloading to Java by Jevgeni Kabanov on Tue Oct 09 11:10:18 EDT 2007
          ·  Re: JavaRebel Brings Class Reloading to Java by Dennis Bekkering on Tue Oct 09 11:16:10 EDT 2007
            ·  Re: JavaRebel Brings Class Reloading to Java by Jevgeni Kabanov on Tue Oct 09 11:22:02 EDT 2007
              ·  same error by Kishore P on Wed Oct 10 16:31:41 EDT 2007
                ·  Re: same error by Jevgeni Kabanov on Wed Oct 10 17:17:40 EDT 2007
                  ·  Re: same error by Dennis Bekkering on Thu Oct 11 05:31:39 EDT 2007
                  ·  Got it worked by Kishore P on Thu Oct 11 14:55:16 EDT 2007
                    ·  Re: Got it worked by Jevgeni Kabanov on Thu Oct 11 15:09:44 EDT 2007
            ·  Re: JavaRebel Brings Class Reloading to Java by Jevgeni Kabanov on Tue Oct 09 11:25:18 EDT 2007
              ·  Re: JavaRebel Brings Class Reloading to Java by Dennis Bekkering on Tue Oct 09 11:56:56 EDT 2007
  ·  Re: JavaRebel Brings Class Reloading to Java by Werner Punz on Tue Oct 09 10:43:52 EDT 2007
  ·  java.lang.IncompatibleClassChangeError by Hung Tang on Tue Oct 09 11:45:26 EDT 2007
    ·  Re: java.lang.IncompatibleClassChangeError by Hung Tang on Tue Oct 09 12:11:49 EDT 2007
      ·  Re: java.lang.IncompatibleClassChangeError by Jevgeni Kabanov on Tue Oct 09 12:37:15 EDT 2007
      ·  Re: java.lang.IncompatibleClassChangeError by Daniel Kordoba on Tue Oct 09 12:41:52 EDT 2007
  ·  Integrating this back into OpenJDK? by Gili T. on Tue Oct 09 11:51:56 EDT 2007
    ·  Re: Integrating this back into OpenJDK? by Daniel Kordoba on Tue Oct 09 12:17:30 EDT 2007
      ·  Re: Integrating this back into OpenJDK? by Dennis Bekkering on Tue Oct 09 12:41:32 EDT 2007
        ·  Re: Integrating this back into OpenJDK? by Daniel Kordoba on Tue Oct 09 12:50:50 EDT 2007
          ·  Re: Integrating this back into OpenJDK? by Dennis Bekkering on Wed Oct 10 05:44:40 EDT 2007
    ·  Re: Integrating this back into OpenJDK? by Mike Heath on Wed Oct 10 16:43:32 EDT 2007
      ·  Re: Integrating this back into OpenJDK? by Daniel Kordoba on Wed Oct 10 17:27:22 EDT 2007
        ·  Re: Integrating this back into OpenJDK? by Oliver Plohmann on Fri Oct 12 11:37:58 EDT 2007
  ·  extends and implements clause changed by jelmer kuperus on Tue Oct 09 12:42:41 EDT 2007
    ·  14 most productive java days (trial software) of your life by Daniel Kordoba on Tue Oct 09 12:49:08 EDT 2007
    ·  Re: extends and implements clause changed by Jevgeni Kabanov on Tue Oct 09 12:52:07 EDT 2007
  ·  It's a BETA by Jevgeni Kabanov on Tue Oct 09 13:01:18 EDT 2007
  ·  Why not with the debugger by Emmanuel Potvin on Tue Oct 09 13:50:49 EDT 2007
    ·  Re: Why not with the debugger by Jevgeni Kabanov on Tue Oct 09 14:02:37 EDT 2007
  ·  Re: JavaRebel Brings Class Reloading to Java by Nikita Ivanov on Tue Oct 09 14:36:37 EDT 2007
  ·  Re: JavaRebel Brings Class Reloading to Java by William Louth on Tue Oct 09 16:44:44 EDT 2007
    ·  Re: JavaRebel Brings Class Reloading to Java by William Louth on Tue Oct 09 17:01:33 EDT 2007
      ·  Re: JavaRebel Brings Class Reloading to Java by Jevgeni Kabanov on Tue Oct 09 17:18:23 EDT 2007
        ·  Have you thought about... by ARI ZILKA on Tue Oct 09 22:20:47 EDT 2007
        ·  Re: JavaRebel Brings Class Reloading to Java by Mike Heath on Wed Oct 10 14:34:36 EDT 2007
    ·  Re: JavaRebel Brings Class Reloading to Java by Jevgeni Kabanov on Tue Oct 09 17:15:19 EDT 2007
  ·  Nice by Oliver Plohmann on Wed Oct 10 02:43:47 EDT 2007
    ·  Re: Nice by Werner Punz on Wed Oct 10 07:35:45 EDT 2007
      ·  Re: Nice by Dennis Bekkering on Wed Oct 10 07:58:26 EDT 2007
        ·  Re: Nice by Jevgeni Kabanov on Wed Oct 10 08:03:55 EDT 2007
          ·  Re: Nice by Dennis Bekkering on Wed Oct 10 09:16:43 EDT 2007
            ·  Re: Nice by Jevgeni Kabanov on Wed Oct 10 09:27:31 EDT 2007
  ·  Re: JavaRebel Brings Class Reloading to Java by Henri Karapuu on Wed Oct 10 03:58:02 EDT 2007
  ·  User experience by Ivo Mägi on Wed Oct 10 04:28:08 EDT 2007
    ·  other agents by Tom Eugelink on Wed Oct 10 05:15:26 EDT 2007
  ·  Apache Commons JCI (+ Apache Cocoon 2.2) by Reinhard Pötz on Thu Oct 11 02:52:27 EDT 2007
    ·  Re: Apache Commons JCI (+ Apache Cocoon 2.2) by Jevgeni Kabanov on Thu Oct 11 05:39:53 EDT 2007
      ·  Re: Apache Commons JCI (+ Apache Cocoon 2.2) by Reinhard Pötz on Thu Oct 11 15:48:15 EDT 2007
        ·  Re: Apache Commons JCI (+ Apache Cocoon 2.2) by Jevgeni Kabanov on Thu Oct 11 18:35:35 EDT 2007
  ·  Re: JavaRebel Brings Class Reloading to Java by Dennis Bekkering on Thu Oct 11 08:47:05 EDT 2007
  ·  The location of classes by Peter Severin on Thu Oct 11 14:44:07 EDT 2007
    ·  Re: The location of classes by Jevgeni Kabanov on Thu Oct 11 15:11:01 EDT 2007
      ·  Re: The location of classes by Dirk Ludwig on Fri Oct 12 03:03:11 EDT 2007
  ·  my valuation of JavaReble by Danny NA on Wed May 07 21:02:24 EDT 2008
    ·  my mistake. by Danny NA on Fri May 09 02:59:17 EDT 2008
  ·  IT Certification by g m on Fri Jul 17 02:11:57 EDT 2009
  Message #240883 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Dennis Bekkering on October 09, 2007 in response to Message #240851
this cant be true right?

  Message #240884 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240883
Just try it :) It's available for download. Not a scam or vaporware.

  Message #240885 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Werner Punz on October 09, 2007 in response to Message #240851
One word, sweet!
This is what java has needed for way too long!

  Message #240887 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Dennis Bekkering on October 09, 2007 in response to Message #240884
um trying with tomcat but I get Unrecognized option: -Xbootclasspath/c:/javarebel.jar, adding as JAVA_OPTS to tomcat does nothing.

  Message #240888 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240887
The option is wrong, don't know where you got it from. Install.html is distributed with JavaRebel.

Try this (exactly):
-noverify -javaagent:javarebel.jar -Xbootclasspath/a:javarebel.jar


  Message #240889 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Dennis Bekkering on October 09, 2007 in response to Message #240888
The option is wrong, don't know where you got it from. Install.html is distributed with JavaRebel.

Try this (exactly):
-noverify -javaagent:javarebel.jar -Xbootclasspath/a:javarebel.jar


when I do so , I get

Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file: javarebel.jar

so I thought a:javarebel.jar should be c:javarebel.jar since I have no a: drive, I also have the javarebel.jar in my classpath

  Message #240890 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240889
when I do so , I get

Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file: javarebel.jar

so I thought a:javarebel.jar should be c:javarebel.jar since I have no a: drive, I also have the javarebel.jar in my classpath


A: is not a drive, -Xbootclasspath/a: adds a JAR to the JVM boot classpath. You have to have the javarebel.jar in the same directory (bin/) for this to work.

  Message #240892 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240889
If you haven't seen the screencast yet, try following the same instructions as there. The installation is in the first minute or so:
http://www.zeroturnaround.com/docs/javarebel-jpetstore-screencast.

  Message #240894 Post reply Post reply Post reply Go to top Go to top Go to top

java.lang.IncompatibleClassChangeError

Posted by: Hung Tang on October 09, 2007 in response to Message #240851
I am experimenting with JavaRebel and I am getting a lot of java.lang.IncompatibleClassChangeError from a sample Struts app. All I'm doing is just adding a system.out statement in an Action class. Any clues as to why it's doing this?

  Message #240896 Post reply Post reply Post reply Go to top Go to top Go to top

Integrating this back into OpenJDK?

Posted by: Gili T. on October 09, 2007 in response to Message #240851
Is there anything preventing one from integrating this back into OpenJDK?

  Message #240897 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Dennis Bekkering on October 09, 2007 in response to Message #240892
If you haven't seen the screencast yet, try following the same instructions as there. The installation is in the first minute or so:
http://www.zeroturnaround.com/docs/javarebel-jpetstore-screencast.


Still no such luck, I will try out later at home. Thanks anyway.

  Message #240900 Post reply Post reply Post reply Go to top Go to top Go to top

Re: java.lang.IncompatibleClassChangeError

Posted by: Hung Tang on October 09, 2007 in response to Message #240894
I am experimenting with JavaRebel and I am getting a lot of java.lang.IncompatibleClassChangeError from a sample Struts app. All I'm doing is just adding a system.out statement in an Action class. Any clues as to why it's doing this?


I forgot to mention that it's a Struts/Spring app if that gives any clue. Can JavaRebel interoperate with Spring-proxied beans?

  Message #240901 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Integrating this back into OpenJDK?

Posted by: Daniel Kordoba on October 09, 2007 in response to Message #240896
Is there anything preventing one from integrating this back into OpenJDK?


I hardly believe that this technology is free. They try to sell it, dont they?

  Message #240904 Post reply Post reply Post reply Go to top Go to top Go to top

Re: java.lang.IncompatibleClassChangeError

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240900
Could we take it to ZeroTurnaround support forums (http://www.zeroturnaround.com/forum/)? We'll be sure to help you.

  Message #240906 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Integrating this back into OpenJDK?

Posted by: Dennis Bekkering on October 09, 2007 in response to Message #240901
I hardly believe that this technology is free. They try to sell it, dont they?


Is that evil? If it works i'd be happy to pay for it.

  Message #240905 Post reply Post reply Post reply Go to top Go to top Go to top

Re: java.lang.IncompatibleClassChangeError

Posted by: Daniel Kordoba on October 09, 2007 in response to Message #240900
Can JavaRebel interoperate with Spring-proxied beans?



Well the screencast uses good old Spring jPetStore

  Message #240907 Post reply Post reply Post reply Go to top Go to top Go to top

extends and implements clause changed

Posted by: jelmer kuperus on October 09, 2007 in response to Message #240851
Hmm I really really wanted this to be true but this little snippet is taken from the site

"Reloads all changes to classes except extends and implements clause changes."

Thats a pretty big gotcha

  Message #240908 Post reply Post reply Post reply Go to top Go to top Go to top

14 most productive java days (trial software) of your life

Posted by: Daniel Kordoba on October 09, 2007 in response to Message #240907
Choose the point in time very wisely! You have only 14 days of being productive 4 free ! ;)

  Message #240909 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Integrating this back into OpenJDK?

Posted by: Daniel Kordoba on October 09, 2007 in response to Message #240906
Is that evil? If it works i'd be happy to pay for it.


Not even close to evil. Innovative things is what our economy is all about after all.


I just wanted to say that I dont believe it to be part of OpenJDK anytime soon.

  Message #240910 Post reply Post reply Post reply Go to top Go to top Go to top

Re: extends and implements clause changed

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240907
Hmm I really really wanted this to be true but this little snippet is taken from the site

"Reloads all changes to classes except extends and implements clause changes."

Thats a pretty big gotcha


We are not really hiding this. It is written in the post as well, if you read it through. It is still a huge advantage, since you can do everything inside classes and create new classes as long as you don't change the inheritance/realization relationship after creating classes. Our shop has been using this for several months and it reduces redeploy count at least by four fifths.

  Message #240916 Post reply Post reply Post reply Go to top Go to top Go to top

It's a BETA

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240851
Haven't mentioned it in the post, but this release (1.0 M2) is still a BETA, so some smoothing out is expected. Don't be put off by problems some of you may encounter, we are working to solve them :)

  Message #240921 Post reply Post reply Post reply Go to top Go to top Go to top

Why not with the debugger

Posted by: Emmanuel Potvin on October 09, 2007 in response to Message #240851
When I remote debug my application deployed on app server with eclipse, a simple save file compile and updates the class on the server, as long as I don't touch the class signature. Your product bypass this leak, but is it possible to work with it the same way using the debugger instead of making the output of the compile on the directory where the application is deployed?

  Message #240922 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Why not with the debugger

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240921
When I remote debug my application deployed on app server with eclipse, a simple save file compile and updates the class on the server, as long as I don't touch the class signature. Your product bypass this leak, but is it possible to work with it the same way using the debugger instead of making the output of the compile on the directory where the application is deployed?

No, sorry. It uses a completely different updating mechanism, which is at least at the moment not possible over the wire. In development it is mostly not a problem to set up compilation this way.

  Message #240924 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Nikita Ivanov on October 09, 2007 in response to Message #240851
Pretty cool stuff. I like the usability of it. Kinks will be fixed up, I'm sure. We have developed our own peer class loading and I can attest that this stuff is very hard to get right from the beginning. Anyways, JavaRebel looks really neat!

Best,
Nikita Ivanov.
GridGain - Grid Computing Made Simple

  Message #240932 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: William Louth on October 09, 2007 in response to Message #240851
Hi,

I am curious to know how JavaRebel handles a change that spans multiple class files such as the removal of a public method or field from one class that is called by another class file that is also changed. I suspect removal is not that common but I am interested to know whether this is indeed supported. How does it handle in concurrent executions across multiple code bases and object state? Are threads suspended?

Can you please list any code related gotchas as well as the additional memory requirements if any for tracking objects (and state).

regards,

William

  Message #240933 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: William Louth on October 09, 2007 in response to Message #240932
Another question I have relates to how this handles reflection (class meta-data) caches held by many frameworks including persistence and aspect oriented interfaces even those proxy based. The problem here is that we are not only talking about code changes here but also configuration files. I suppose this solution is geared toward development and were the developers understand the implications of code changes in relates systems and components.

I have not downloaded it yet but I am really curious about what this can and cannot do and how it is implemented in a safe manner to ensure the cycle of debugging (or testing) is not completely broken.

I will have download the tool and fire up my runtime class meta-data explorer to see what is going in under the hood.

regards,

William

  Message #240935 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240932
Hi,

I am curious to know how JavaRebel handles a change that spans multiple class files such as the removal of a public method or field from one class that is called by another class file that is also changed. I suspect removal is not that common but I am interested to know whether this is indeed supported. How does it handle in concurrent executions across multiple code bases and object state? Are threads suspended?


First of all there is no real problems with multiple modifications. E.g. I've been doing method rename refactors over a large code base.

There are some quirks with concurrency at the moment, but mostly connected to reloading classes before compiler finished writing them and similar. The core logic should be fine.

You should also remember that the tool is only targeted for development (at least at the moment), so if a border case comes up very rarely it is not really a problem to restart the server. I know of a number of border cases that won't be reloaded now, but they will be fixed by the final release.

  Message #240936 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Jevgeni Kabanov on October 09, 2007 in response to Message #240933
Another question I have relates to how this handles reflection (class meta-data) caches held by many frameworks including persistence and aspect oriented interfaces even those proxy based. The problem here is that we are not only talking about code changes here but also configuration files. I suppose this solution is geared toward development and were the developers understand the implications of code changes in relates systems and components.

Caches are a problem, a lot of developers assume reflection will always return the same methods, although Java spec doesn't really say that. We'll just have to work with the frameworks at some point. Same goes to configuration, JavaRebel only handles class reloading.

  Message #240943 Post reply Post reply Post reply Go to top Go to top Go to top

Have you thought about...

Posted by: ARI ZILKA on October 09, 2007 in response to Message #240936
Wiring this up to Terracotta? One technology pulls the state out of the running object instances. The other allows you to change the class definition on the fly. Could be interesting...

Hmmm.

--Ari

  Message #240947 Post reply Post reply Post reply Go to top Go to top Go to top

Nice

Posted by: Oliver Plohmann on October 10, 2007 in response to Message #240851
Now Java will be almost as interactive and productive as Smalltalk, Ruby, Groovy, and ... I just wonder why this doesn't come from Sun. Instead of improving their hot code replacement feature they put loads of all other kinds of things into every new JDK ...

Regards, Oliver

  Message #240949 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Henri Karapuu on October 10, 2007 in response to Message #240851
You are my personal Jesus Christ the Saviour.

Trying this out right now. If it works i would had been ready to pay much more.

/Henkka Karapuu

  Message #240954 Post reply Post reply Post reply Go to top Go to top Go to top

User experience

Posted by: Ivo Mägi on October 10, 2007 in response to Message #240851
I am not completely neutral in the topic as I work within the company who invented JavaRebel, but we as a regular Java shop are currently using it in all our projects (30+) and all developers are really happy with it.

  Message #240960 Post reply Post reply Post reply Go to top Go to top Go to top

other agents

Posted by: Tom Eugelink on October 10, 2007 in response to Message #240954
How does this work when other agents (e.g. Toplink) are active?

  Message #240962 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Integrating this back into OpenJDK?

Posted by: Dennis Bekkering on October 10, 2007 in response to Message #240909
I just wanted to say that I dont believe it to be part of OpenJDK anytime soon.


point taken ;)

  Message #240968 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Nice

Posted by: Werner Punz on October 10, 2007 in response to Message #240947
Now Java will be almost as interactive and productive as Smalltalk, Ruby, Groovy, and ... I just wonder why this doesn't come from Sun. Instead of improving their hot code replacement feature they put loads of all other kinds of things into every new JDK ...

Regards, Oliver


Good question, my personal guess is they simply couldnt pull it off in a safe manner, and sun has the habit of trying to make things 100% save. The main problem I see is, that a dynamic class reloader while having its merits in a production system is most important in development systems where you dont need 100% safety but you need everything in your hands to keep useless development downtimes at a minimum. I think the guys who programmed this have a much saner approach to the problem by just telling, dont use it in production and there are some cases which cannot workout fully, but then simply restart the webapp/server.

  Message #240969 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Nice

Posted by: Dennis Bekkering on October 10, 2007 in response to Message #240968
I am amazed that it can be done in Java. I thought it could only be done in the C code of the VM.

  Message #240970 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Nice

Posted by: Jevgeni Kabanov on October 10, 2007 in response to Message #240969
I am amazed that it can be done in Java. I thought it could only be done in the C code of the VM.


Did you get it to work with Tomcat in the end?

  Message #240976 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Nice

Posted by: Dennis Bekkering on October 10, 2007 in response to Message #240970
I am amazed that it can be done in Java. I thought it could only be done in the C code of the VM.


Did you get it to work with Tomcat in the end?


I visited my mom after work and there was no more time left to try it out, I have my hopes set on tonight ;)

  Message #240977 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Nice

Posted by: Jevgeni Kabanov on October 10, 2007 in response to Message #240976
I am amazed that it can be done in Java. I thought it could only be done in the C code of the VM.


Did you get it to work with Tomcat in the end?


I visited my mom after work and there was no more time left to try it out, I have my hopes set on tonight ;)


If you'll still have any trouble let us know via support (at) zeroturnaround (dot) com.

  Message #240997 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Mike Heath on October 10, 2007 in response to Message #240936
Another question I have relates to how this handles reflection (class meta-data) caches held by many frameworks including persistence and aspect oriented interfaces even those proxy based. The problem here is that we are not only talking about code changes here but also configuration files. I suppose this solution is geared toward development and were the developers understand the implications of code changes in relates systems and components.

Caches are a problem, a lot of developers assume reflection will always return the same methods, although Java spec doesn't really say that. We'll just have to work with the frameworks at some point. Same goes to configuration, JavaRebel only handles class reloading.


It looks like there are some issues with reflection even without framework caching. If I add a public method to a class, after the class gets reloaded the added method doesn't show up via reflections. I'm guessing this should be fixable. I'll try and log an example case in the forums.

Regardless, JavaRebel is awesome. Even with its quirks, my productivity has increased. I'll be buying a license.

  Message #241006 Post reply Post reply Post reply Go to top Go to top Go to top

same error

Posted by: Kishore P on October 10, 2007 in response to Message #240890
I also got the same error. I tried it in weblogic 9.2.
I saved the jar file in bin/ and added the java option in startWeblogic.cmd file.

Any idea what whould have gone wrong?

Thanks,

  Message #241007 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Integrating this back into OpenJDK?

Posted by: Mike Heath on October 10, 2007 in response to Message #240896
Is there anything preventing one from integrating this back into OpenJDK?


Since Sun requires the author of any OpenJDK contribution to give Sun co-ownership, it's up to the author of JavaRebel to consider trying to contribute this to OpenJDK. Considering the the fact that JavaRebel is something if a hacked solution, I can't see it getting accepted into OpenJDK anyway.

I hope that JavaRebel will provide the impetus to finally get Java bug 4910812 fixed. Not being able to hot swap classes with a changed signature has been an issue with Java for far too long. I'm using JavaRebel now and it is a HUGE productivity boost for me. I can't figure out how I've gone so long without it. It's no wonder there are so many Java haters in the Ruby camp.

  Message #241010 Post reply Post reply Post reply Go to top Go to top Go to top

Re: same error

Posted by: Jevgeni Kabanov on October 10, 2007 in response to Message #241006
I also got the same error. I tried it in weblogic 9.2.
I saved the jar file in bin/ and added the java option in startWeblogic.cmd file.

Any idea what whould have gone wrong?

Thanks,


That error means that the jar file cannot be found on the path where it should be. As far as I remember in WL9 your working directory is the domain, while the script is in a subdirectory. If you put javarebel.jar into the domain directory, it should work.

  Message #241011 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Integrating this back into OpenJDK?

Posted by: Daniel Kordoba on October 10, 2007 in response to Message #241007
If this software does what it is supposed to do, I think it will be a cash machine. Java is so popular, it has so many developers who have been praying for such a functionality for so many years now.


We dont even need this thing to be perfect. Just make it do the dynamic class reloading in a develoment environment.



Man I would love to have that in the JDK right NOW. But nooooo we must have Beans Binding, new Property Accesors and three approaches to closures instead. :(

  Message #241019 Post reply Post reply Post reply Go to top Go to top Go to top

Apache Commons JCI (+ Apache Cocoon 2.2)

Posted by: Reinhard Pötz on October 11, 2007 in response to Message #240851
Apache Commons JCI has been providing a reloading classloader for some time and the Apache Cocoon project has been using it. Since this year there is also an official release of the JCI library.

Using the reloading classloader for development is really awesome. For Cocoon 2.2 we provide a Maven 2 plugin that does almost all the configuration for you by weaving in the reloading classloader support.

And yes, if you use frameworks like Spring it isn't enough to just reload classes because e.g. once a bean is loaded into the singleton scope, the class definition isn't required anymore. Also, XML bean definition files can change. The Cocoon integration takes care for this by resetting the Spring application context if required.

Find more information at http://www.indoqa.com/en/people/reinhard.poetz/blog/560

  Message #241027 Post reply Post reply Post reply Go to top Go to top Go to top

Re: same error

Posted by: Dennis Bekkering on October 11, 2007 in response to Message #241010
System.err.println( new File("").getAbsolutePath()) shows you the right directory when your server is running

  Message #241029 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Apache Commons JCI (+ Apache Cocoon 2.2)

Posted by: Jevgeni Kabanov on October 11, 2007 in response to Message #241019
Well, JavaRebel updates not only class definitions, but also all of the object state so there is no need to reload Spring context. Solutions like JCI have existed for some time and just are not enough (we did even more for Aranea by also serializing/deserializing object state, but that still wasn't enough).

  Message #241038 Post reply Post reply Post reply Go to top Go to top Go to top

Re: JavaRebel Brings Class Reloading to Java

Posted by: Dennis Bekkering on October 11, 2007 in response to Message #240851
I have got it working, it is hard to express how this makes me feel, liberated comes close

  Message #241063 Post reply Post reply Post reply Go to top Go to top Go to top

The location of classes

Posted by: Peter Severin on October 11, 2007 in response to Message #240851
How exactly the location of classes is determined? We don't place our classes under WEB-INF/classes. Instead, we have a custom ClassLoader that loads classes from multiple locations which helps us support our multi-project application structure.

I've tried JavaRebel, but it wasn't able to location our classes as far as I can tell. The custom ClassLoader is a subclass of URLClassLoader so it should be possible to determine the URLs with class locations from it...

  Message #241064 Post reply Post reply Post reply Go to top Go to top Go to top

Got it worked

Posted by: Kishore P on October 11, 2007 in response to Message #241010
Thanks for the response, I got the stuff worked, I love it. But there is problems with debugger I guess, Eclipse is not able to setup the break points any idea why? any resolution?

Thanks for the help

  Message #241065 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Got it worked

Posted by: Jevgeni Kabanov on October 11, 2007 in response to Message #241064
Thanks for the response, I got the stuff worked, I love it. But there is problems with debugger I guess, Eclipse is not able to setup the break points any idea why? any resolution?

Thanks for the help


Could you post this question to ZeroTurnaround forum? And perhaps elaborate a bit?

  Message #241066 Post reply Post reply Post reply Go to top Go to top Go to top

Re: The location of classes

Posted by: Jevgeni Kabanov on October 11, 2007 in response to Message #241063
How exactly the location of classes is determined? We don't place our classes under WEB-INF/classes. Instead, we have a custom ClassLoader that loads classes from multiple locations which helps us support our multi-project application structure.

I've tried JavaRebel, but it wasn't able to location our classes as far as I can tell. The custom ClassLoader is a subclass of URLClassLoader so it should be possible to determine the URLs with class locations from it...


Sorry, custom classloaders are not supported at the moment. If you post a feature request at ZeroTurnaround forum we might work something out in some time.

  Message #241067 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Apache Commons JCI (+ Apache Cocoon 2.2)

Posted by: Reinhard Pötz on October 11, 2007 in response to Message #241029
The manipulation of the object state sounds nice :-) But this still doesn't solve the problem if e.g. a Spring application context is setup using an XML file and there is a change in the dependency graph, a bean added/deleted etc. Do you provide any hooks so that you can react on a changing resource?

  Message #241070 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Apache Commons JCI (+ Apache Cocoon 2.2)

Posted by: Jevgeni Kabanov on October 11, 2007 in response to Message #241067
The manipulation of the object state sounds nice :-) But this still doesn't solve the problem if e.g. a Spring application context is setup using an XML file and there is a change in the dependency graph, a bean added/deleted etc. Do you provide any hooks so that you can react on a changing resource?


JavaRebel only solves class reloading while preserving object instances. We realize that it doesn't solve all problems, but it solves a lot of annoying problems, where small changes take a lot of time. We have some ideas for other changes as well.

  Message #241078 Post reply Post reply Post reply Go to top Go to top Go to top

Re: The location of classes

Posted by: Dirk Ludwig on October 12, 2007 in response to Message #241066
How exactly the location of classes is determined? We don't place our classes under WEB-INF/classes. Instead, we have a custom ClassLoader that loads classes from multiple locations which helps us support our multi-project application structure.

I've tried JavaRebel, but it wasn't able to location our classes as far as I can tell. The custom ClassLoader is a subclass of URLClassLoader so it should be possible to determine the URLs with class locations from it...


Sorry, custom classloaders are not supported at the moment. If you post a feature request at ZeroTurnaround forum we might work something out in some time.


Just out of curiosity: How does JavaRebel work with application servers then? At least WebLogic and JBoss do use custom classloaders.

Regards,
Dirk

  Message #241112 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Integrating this back into OpenJDK?

Posted by: Oliver Plohmann on October 12, 2007 in response to Message #241011
Man I would love to have that in the JDK right NOW. But nooooo we must have Beans Binding, new Property Accesors and three approaches to closures instead. :(


Exactly. Seems to me that the people at Sun do not have the Smalltalk/Ruby/Groovy thinking. If you look at eclipse you see the Smalltalk IDE behind it. If you look at NetBeans you see VisualStudio behind it ... So what can you expect from these people. Looks like the only thing that Sun took over from the David Ungar/Self people were the technologies like the HotSpot optimizer and the train GC. But the approach towards development they brough in was not understood.

Cheers, Oliver

  Message #252113 Post reply Post reply Post reply Go to top Go to top Go to top

my valuation of JavaReble

Posted by: Danny NA on May 07, 2008 in response to Message #240851
I tried JavaRebel to help me save time when deploy application into tomcat.my application is using spring. as some above comments say, JavaRebel not only reloads the class definition but also keeps the object states.that sounds really cool.

1. However actually every time I changed a java file, JavaRebel still triggered reloading spring context. is it supposed?
2. normally for a deployment without JavaRebel, my tomcat takes 28 seconds to make it ready for service. however with JavaRebel, it takes 49 seconds for the first deployment and about 31 seconds for redeployment.
3.my application includes class A, and A depends on javax.jms.MessageListener, if I deploy this application in JBoss, this application will use class A, while in Tomcat it never uses class A. if I use JavaRebel in tomcat,JavaRebel throws java.lang.NoClassDefFoundError unless I copy JBoss-j2ee.jar to tomcat.

Hope JavaRebel can conquer these problems.

  Message #252195 Post reply Post reply Post reply Go to top Go to top Go to top

my mistake.

Posted by: Danny NA on May 09, 2008 in response to Message #252113
"1. However actually every time I changed a java file, JavaRebel still triggered reloading spring context."
not the problem from JavaRebel, I should have disabled "reloadable" for tomcat configuration file "server.xml"

now happy to use JavaRebel although the first deployment becomes slow and I have to copy some unnecessary jar files to my application.

  Message #311833 Post reply Post reply Post reply Go to top Go to top Go to top

IT Certification

Posted by: g m on July 17, 2009 in response to Message #240851
Pass4sure Practice Exams are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development. Following are some of P4S product list:
650-393
70-643
70-638
642-661
640-721
132-S-911.2
70-649
642-611
70-672
MB6-817
1Y0-259
70-236
70-298
70-646
N10-004

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

Static and Dynamic Analysis: Best Practices, New Approaches

Application development teams are increasingly turning to automation in order to improve their processes and produce higher quality software. In this webcast, Peter Varhol will describe how to use static and dynamic analysis to improve the software development process and deliver a quality application. (July 7, Tech Talk)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Remote Lazy Loading in Hibernate

Lazy loading means fetching and loading the data, only when it is needed, from a persistent storage like a database. Premkumar Rajendran describes how to implement a lazy loading solution within Hibernate by extending the Hibernate framework. (May 12, Article)

What is the Asynchronous Web, and How is it Revolutionary?

The concept of the Asynchronous Web can revolutionize web applications, but is Java EE positioned to support it? In this two-part article, the authors delve into various aspects of the Asynchronous Web in an effort to scope the problem domain, and then analyze how the Java EE technology stack can support it. (April 28, Article)

EJB 3.1 - A Significant Step Towards Maturity

Paulo Moreira describes the EJB 3.1 specification and how it can make a difference in developing server-side Java applications. (April 21, Article)

Free Book: Jakarta-Struts Live

Download the entire book of Jakarta-Struts Live and learn about Struts MVC, Tiles, the Validator, DynaActionForms, plug-ins, internationalization, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map