facebook

Glassfish: Exploded deployments

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #274560 Reply

    I’m trying to find the best way to deploy my EJB application to Glassfish. When I add my project to the server, the option Exploded Archive is checked by default. So I deploy the application this way, make a little change, redeploy the aplication, but the change doesn’t get through. When I redeploy, a dialog shows up for a fraction of a second, but there is no activity in the server log file. Should this exploded deployment work with GlassFish v2? (i’m using b58). It does work when I select “Packaged Archive” and redeploy this way.

    Another question: whenever I make a change to my EJB code, am I supposed to click the servers tab, right click my project name and hit “Redeploy” manually? Is there are a keyboard shortcut to re-deploy the last executed deployment, or an option to automatically redeploy when I make changes to the code?

    Thanks in advance for your reply!

    #274615

    Riyad Kalla
    Member

    bosmeeuw,
    When you use an exploded deployment, your changes are deployed as soon as you save the file.

    Also make sure you are running the server in *debug* mode, and not hitting the “run” button from the server view in order to see your changes right away.

    #274627

    Thanks for your reply rkalla. Yes, changes get through when I run in debug mode, but then you can only make changes which don’t affect any of your server side class signatures. When I add a method, eclipse tells me it couldn’t hot swap the code, which is expected. But then when I redeploy my project (right clicking on the project in the server tab), the code still doesn’t get updated and there is no activity in the server log.

    I can live with redeploying in packaged mode, but is there a keyboard shortcut for this, or can I automate this whenever I change server side code? It’s a bit cumbersome to redeploy using the mouse each time I make a change.

    #274631

    Riyad Kalla
    Member

    Yes, changes get through when I run in debug mode, but then you can only make changes which don’t affect any of your server side class signatures.

    Correct. That’s a limitation of hot-syncing in the VM 🙁

    When I add a method, eclipse tells me it couldn’t hot swap the code, which is expected. But then when I redeploy my project (right clicking on the project in the server tab), the code still doesn’t get updated and there is no activity in the server log.

    Hmm that’s not right. It should restart the server which should in turn load your new code.

    #274636

    A full server restart would be a bit overkill I think (especially since this can take more than a minute).
    What it should do is the same as when I redeploy in packaged mode: redeploy the ejb application on the running server.

    Is there a keyboard shortcut to redeploy? Else I will just drop this and use standard WTP, which does seem to automatically redeploy (albeit always in packaged mode) whenever you save a server class.

    #274640

    Riyad Kalla
    Member

    A full server restart would be a bit overkill I think (especially since this can take more than a minute).
    What it should do is the same as when I redeploy in packaged mode: redeploy the ejb application on the running server.

    That’s entirely up to the server. I know in Tomcat you can set it up to reload when it sees changed resources, and it will reload the context for that webapp. Sounds like Glassfish will by default reload when it sees a new deployment package, but not a new class.

    What I personally do to get around this is to keep the admin console open inside of MyEclipse in the browser view, and manually tell it to reload the context as I work. Usually pretty quick.

    Is there a keyboard shortcut to redeploy? Else I will just drop this and use standard WTP, which does seem to automatically redeploy (albeit always in packaged mode) whenever you save a server class.

    No there isn’t a keyboard shortcut for it. We are sorry to loose you over this. I will file this request in our issue tracker and see if we can improve this experience in a future release.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Glassfish: Exploded deployments

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