facebook

One click functionality

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #206962 Reply

    jreuveni
    Member

    Hello,
    Our group is using NetBeans as an IDE for web app development and we wanted to move to Eclipse with MyEclipse plugin. The problem we are encountering is that every change we make in the app it has to be redeployed and Tomcat has to be stopped and restarted again. In NetBeans Tomcat is built into the IDE and with one click “force execute” Tomcat is started, app deployed, and the browser starts with your app. Is there a way to do this with MyEclipse.

    Thank you for your help,
    Johnatan

    #206963 Reply

    Riyad Kalla
    Member

    Is there a way to do this with MyEclipse.

    Definately.

      1. First, go here, Window > Preferences > Workbench > “Perform build automatically on resource modification”, and make sure this is checked.

      2. Now go to the deployment tool and setup an exploded deployment (you do not get hot-deploy with packaged deployment because recreating/deploying the WAR on every change is too expensive for large apps).

      3. Now make sure you have Tomcat setup to notice changes and reload them, you can do this via the Tomcat Administrator, by selecting your context. The property is called “reloadable” and you want to set it to “true”.

      4. Now stop Tomcat, redeploy and restart Tomcat just to make sure and you should be all set.

    Now all changes (JSP, class, properties and XML) will be hot-deployed to Tomcat when they are changed (on-save) and its up to Tomcat to reload them. I believe the default timeout is 15second intervals (for Tomcat to check for changed resources).

    You might notice that sometimes an error will popup talking about how the resource is no longer in sync and hot-deploy failed… that is a message from Tomcat’s debugger to the Eclipse debugger and isn’t necessarily always true. For example, if you get that popup, keep watching the Tomcat console, you might see a class reload execute anyway, you can just close the window and keep programming. What that warning is good for though is a good indicator when its a good idea to restart Tomcat if you are having quirky behavior.

    I’ve coded before and NEVER gotten the popup even though I was redeploying Actions, Forms, Servlets and JSPs. Othertimes I’ll get that warning right away… I rarely restart Tomcat though, I usually just keep the manager open in another browser window, and just hit “reload” on the context for the app I’m working on, that does the trick perfectly.

    Please let us know if you run into any problems.

    #207010 Reply

    jreuveni
    Member

    Dear rkalla,
    Thank you for your quick response. I have been doing what you mentioned in your response before. The first time I deploy everything seems to work fine, I get my web app under Tomcat’s webapp directory ->perfect. When I make changes, recompile, and try to redeploy, it deletes everything under my context root, leaving me with an empty directory of my app (webapp/myApp, ->myApp is empty). In addition, is it possible to hit one button and have it launch Tomcat and a browser with your app in the browser like NetBeans?

    Thanks again,
    Johnatan

    #207015 Reply

    Riyad Kalla
    Member

    The first time I deploy everything seems to work fine, I get my web app under Tomcat’s webapp directory ->perfect.

    So far so good…

    When I make changes, recompile, and try to redeploy, it deletes everything under my context root, leaving me with an empty directory of my app (webapp/myApp, ->myApp is empty)

    As long as you followed my steps above (about having ‘Build automatically on resource mod’) you shouldn’t need to always open up the deploy tool and redeploy as your changes are immediately deployed when you save the file.

    When you click “redeploy” that is actually a combined action of “remove” and “deploy”, so removing all the files temporarily for a split second before it deploys them again sounds ok, but just clearing out the directory sounds wrong… when you highlight your project in the deployment tool, is there any message below showing you an error? Do you have any exceptions in your Eclipse log file? (<workspace dir>\.metadata\.log)

    In addition, is it possible to hit one button and have it launch Tomcat and a browser with your app in the browser like NetBeans?

    No there isn’t currently, although we have it on our todo list. I think most people get around this by simply keeping the browser open and hitting refresh while working on their app.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: One click functionality

You must be logged in to post in the forum log in