Results 1 to 7 of 7

Thread: dm Server and Hot Deployment?

  1. #1

    Default dm Server and Hot Deployment?

    When working with MyEclipse and Eclipse on web projects, I'm used to updating my Java Class, JSP, and/or CSS in tiny increments, pressing Ctrl-S to save the resource, and then refreshing my browser to see the change, all within less than a second per iteration (and this code/test cycle gets run thousands of times a day).

    Under the covers the deployment manager takes care of deploying the updated copy of the resource to the servlet container directly to its working location for exploded war archives (for example, in Tomcat, this would be ${catalina.base}/webapps/${contextPath}/**). The app server would then immediately pick up the changed resource and display it (well, in Tomcat if the resource changes twice in under 5 seconds it may take up to 5 seconds after the first resource was deployed for the second update to appear because Tomcat only checks the File.lastModified() at most once every 5 seconds).

    Anyway, in STS 2.2 and dm Server 2.0 (M6), I see my update getting written to to src/main/webapp folder (or from target/classes), and then I see the "synchronizing/publishing" and it gets copied to the stage folder (I think this is what the "synchronizing" is doing, I also think this step is called "publishing"). I realize this stage directory is arbitrary and dm server doesn't know anything about it. However, there it just sits. I can even stop and restart the bundle, and nothing. It isn't until I Redeploy the bundle, causing the entire work directory copy of the bundle to be removed, a new copy to be written, and the webapp completely restarted and reiniitialized, do I see my change. Since our webapp takes 45 seconds to initialize, that means my change/test cycle that I do thousands of times a day just went from sub-second to 45 seconds.

    Is this the intended behavior of STS and dm Server? I don't know if swapping bundle resources out from under the OSGi container while the bundle is running is allowed (or even part of the spec), or if hot-swapping bundle components is available, but without it, I think the usability of it is broken.

    I would hope that for Java classes, that not only does the new .class file arrive in the stage directory, but that also (if you're in debug mode) that the new .class file gets hot-swapped in (I haven't tried it). However, it would be really weird to restart dm Server only to have it revert back to prior code since the updated .class file is still sitting in the stage directory and not actually copied/deployed to the work folder.

    So, is this how dm server is supposed to work? What are the alternatives for hot-swapping in web resources and other bundle contents in a live/running OSGi web container?

    -J.C.
    Last edited by jchamlin; Nov 3rd, 2009 at 04:46 PM.
    J.C. Hamlin
    Principal Consultant
    Technology Partners LLC
    http://www.technology-partners.net

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    Try with an older version of dm server. Sts isn't supporting m6 yet. M6 changed directory structures as compared to other versions.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3

    Default

    Quote Originally Posted by Marten Deinum View Post
    Try with an older version of dm server. Sts isn't supporting m6 yet. M6 changed directory structures as compared to other versions.
    Is there a nightly/CI build of STS that supports this functionality that we could try? If not, when do you think a build of STS will be available that ships with and supports dm Server 2.0?

    Is there an existing JIRA issue for this issue we can track?

    Thanks!

    -J.C.
    J.C. Hamlin
    Principal Consultant
    Technology Partners LLC
    http://www.technology-partners.net

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    There is a post of today by Christian Dupuis which points to the new nightly which should support it.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5

    Default

    Quote Originally Posted by Marten Deinum View Post
    There is a post of today by Christian Dupuis which points to the new nightly which should support it.
    Can you post a link to Christian Dupuis's post? I can't find it. Do you mean this one posted yesterday? http://forum.springsource.org/showthread.php?t=80010 with this as the nightly update site: http://dist.springsource.com/snapshot/DMS-TOOLS/nightly

    We tried that with today's build of dm Tools (11/4) and the CI-453 build of dm Server and no luck. The files listed in the Redeploy Behavior section of the Spring Source dm Server v2.0's Overview tab are still not being auto-copied to the right location. Should I file a JIRA ticket?

    Thanks!

    -J.C.
    J.C. Hamlin
    Principal Consultant
    Technology Partners LLC
    http://www.technology-partners.net

  6. #6
    Join Date
    Oct 2008
    Posts
    493

    Default

    The latest dm Sever tools should work fine with 2.0.0.M6. I've asked Christian to take a look at this thread so that we can figure out what the problem is.
    Andy Wilkinson
    SpringSource

  7. #7
    Join Date
    Oct 2008
    Posts
    493

    Default

    After a quick chat with Christian, and a re-read of the original post, it's dawned on me that you're most likely suffering from DMS-1120 and DMS-1121.

    To rephrase my earlier statement, the dm Server tools should work fine with 2.0.0.M6, apart from updates to static resources. Apologies for the inconvenience.
    Andy Wilkinson
    SpringSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •