7 Replies Latest reply on May 13, 2016 9:06 PM by ggopalkrishna

    JRebel support and configuration

    thomas.schiffmann Novice

      I tried to set up my development environment with JRebel to reduce the number of redeployments. It seems to work when I do not deploy any plugins. Unfortunately, if I do deploy plugins, the server fails to start up with a lot of ClassNotFoundExceptions (and NoClassDefFoundErrors) for generated classes (especially RebelLocator$* and EnhancerByCGLib$*). Is anybody using JRebel successfully with Jive plugins? Are there any special plugins for JRebel required?


      I think I set up the rebel configuration correctly (monitoring web app classes and resources and monitoring plugin classes and dependencies). I'm using Jive 5.0.3.

        • Re: JRebel support and configuration
          thomas.schiffmann Novice

          It seems to depend on the plugin. I can reproduce it with the Community Manager Reports Plugin and also with our custom plugins. I don't know exactly why this happens with the community manager reports plugin, but the reason why it happens with our custom plugins is probably CGLib proxying (see Implementing aspects by proxying Spring beans). The classes that are generated are defined (ClassLoader.defineClass()) in the ChainingClassLoader, but this class only delegates to the parent classloader and plugin classloaders (see ChainingClassLoader.loadClass(String clazzname)). Hence the classes that are generated at runtime, cannot be loaded by other generated classes - resulting in ClassNotFoundExceptions. I implemented a JRebel plugin to patch the ChainingClassLoader and it works now for all our plugins.


          Now I'm curious about how good JRebel works with Jive. Can anybody share some experiences?

            • Re: JRebel support and configuration
              ggopalkrishna Novice

              Hi Thomas,


              Were you able to fix this issue. I am working on plugin & it takes lot of time in restarting JIVE everytime I deploy the plugin. Hot code swap will be very useful & save lot of time.




                • Re: JRebel support and configuration
                  Scott A Johnson Advanced

                  Hey Guruprasad,


                  We tried using JRebel last year for our group. We had mixed results. For the most part, Java classes updated relatively automatically (usually after running maven package). I dont recall configuration updating cleanly (spring.xml, struts.xml). Occasionally struts actions would just stop working and we would need to restart the server.


                  It took us quite a bit of time working with JRebel support to try to debug through the issues and were never able to really get it working as advertised, even though everytime their sales team called me they assured me that the latest version of JRebel would work with Jive. All-in-all, did it save us time? Sure it probably saved some time in restarts over the year. If you're going to be doing a consistent amount of plugin development in Jive, you'll probably see a good return on investment, but be prepared for it to not quite do everything advertised and you should probably just accept that, unless you've got time and patience enough to sit on a number of calls with their Support team to try to get it completely working. I know I didn't.


                  Hope that helps,


                  1 person found this helpful
                  • Re: JRebel support and configuration
                    ggopalkrishna Novice


                    Finally I was able to get jrebel working. Following configurations are required.

                    1) jrebel.xml file. You can generate this within IDE. RIght click project & you see Jrebel nature.

                    2) You need to add following in {jivehome}/web/pom.xml


                    -javaagent:jrebel.jar(path to jrebel jar)


                    Thats all it will sync with your local jive instance. Don't forget to add your plugins directory in pom.xml



                            <plugin.dirs>{path to your plugin}</plugin.dirs>