4 Replies Latest reply on Apr 9, 2014 8:03 PM by tomdcc

    Editing a JSP in Eclipse always redeploys the whole webapp (Wildfly 8.0.0)

    tomdcc

      Hi all

       

      Running Eclipse Kepler with JBoss Tools 4.1.2, running a webapp on local Wildfly 8.0.0.Final standalone instance.

       

      Run on Server functionality works pretty well, but there are some major annoyances:

      • When I edit a JSP, the entire context gets restarted, as soon as I change a file. That's really, really annoying, as it resets my session every time. A JSP change really shouldn't trigger a full application restart. This happens whether my publishing settings are set to "Automatically publish when resources changes" or "Automatically publish after a build event". If I select "Never publish automatically" then the JSP is never copied to the exploded deployment directory and the changes never appear.
      • If I'm debugging, I'd expect that certain changes to files would be hot-patchable into the JVM, e.g. just adding a logging line or some non-structural changes inside a method should just patch the class in the running server, but once again either of the "Automatically publish" options will redeploy the entire webapp. If I select "Never publish automatically" then the changes do get hot-patched.
      • If I'm debugging and have "Never publish automatically" set, when I make structural changes to a class, Eclipse informs me that it can't hot deploy that change, and gives me the option of restarting the process. When I click the restart button, the version of the class that is running is the old one from before the restart! The only way to get it to deploy properly is to terminate the process and re-launch Wildfly, or click continue and manually issue a publish.

       

      What I'd really like is to be able to run in debugging mode and have non-structural changes hot deployable, with files like JSPs and other resources copied in to the exploded directory. A double-bonus would be if the Restart option from the hot-deploy failed dialog would do a republish before restarting the app, but that's minor compared to the other stuff.

       

      I'm pretty sure this is an issue with the Eclipse JBoss Tools plugins rather than Wildfly configuration, as when I have the "Never publish automatically" setting selected and manually update and copy a JSP in, the JSP does get recompiled by Wildfly without restarting the whole app.

       

      Any suggestions?

       

      Thanks

       

      Tom

        • 1. Re: Editing a JSP in Eclipse always redeploys the whole webapp (Wildfly 8.0.0)
          maxandersen

          Lets please separate the two cases:

           

          Editing java classes:

          For having classes hotswapped you need to be debugging. It is via the connected debugger that methods in classes can get changed in standard java vm's. This afaik *just* works.

          You just mention class - not if it is a .java or .jsp you are editing but if it is .java this does "just work" afaik.

           

          Editing JSP:

          Unless you somehow stumbled on a bug jbosstools does not do anything but copy the jsp resources over. Restart of an app will by default not happen unless you explicitly force a full publish or change a jar (since for jars a reload is necessary in all cases). If you can create a sample project and outline which steps you do to see the app get restarted (the server console should print info about this) I would be very interested.

          1 of 1 people found this helpful
          • 2. Re: Editing a JSP in Eclipse always redeploys the whole webapp (Wildfly 8.0.0)
            tomdcc

            Huh, ok. So I went about creating a minimal test case, which worked pretty much exactly as I wanted it to. Then on re-running the app that I had been running, it worked properly too!

             

            In the course of doing all that, I noticed in the Servers view that there were two versions of my app under the Wildfly server, one of which had [Started, Synchronized] next to it, and one of which just said [Started] next to it. I have no idea how the duplicate entry got into there (how is it even possible?), but when deploying my test case I just cleared everything out, and having re-run my app afterwards there now seems to only be one entry there. I presume that that is related to the constantly-redeploying issue, but I have no idea how to recreate it now (and don't really want to ). Hopefully if anyone else has this issue they might be able to find an answer here as to how to get out of it.

             

            Thanks anyway for answering Max

            • 3. Re: Editing a JSP in Eclipse always redeploys the whole webapp (Wildfly 8.0.0)
              maxandersen

              Thanks for helping

               

              If you ever manage to recreate the situation where you deployed both let us know.

               

              But here is my theory:

              Maybe you have a .war of the project somewhere that gets updated automatically and you used "mark as deployable" which would make it possible to deploy the

              war to the server ...then after that you actaully deployed the "real project" and boom you could end up in this situation I imagine.

               

              Could that match what you did ?

              • 4. Re: Editing a JSP in Eclipse always redeploys the whole webapp (Wildfly 8.0.0)
                tomdcc

                I'm a bit new to the tooling for running this stuff from inside eclipse, so it's entirely possible that I clicked "mark as deployable" at some point to see what it did.

                 

                I don't think I have a war that gets updated automatically, unless the eclipse files generated by the gradle eclipse-wtp plugin set things up to do that.

                 

                Anyway if I manage to recreate it I'll let you know.

                 

                Cheers