Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: java agent based reloading

  1. #1
    Join Date
    Apr 2011
    Posts
    3

    Default java agent based reloading

    Can anyone provide more information about the new feature on the server tab called "java agent based reloading". I gave it a short try and it reloaded properly my classes. But I'm wondering if this is a tc server feature and which functionality is provided with it.

    Is there any documentation about it?

    thanks
    Claude

  2. #2
    Join Date
    May 2009
    Location
    Vancouver
    Posts
    274

    Default

    Hi Claude,

    The Java agent based reloading isn't only usable under tc Server, it is a general approach, but we've spent most of our time testing under tc Server. *Currently* we package it as part of the SpringSource Tool Suite, but that may change over time.

    I don't think I've written down the feature list (or limitation list) anywhere actually, so let me give you some idea here. (I did talk about it at SpringOne and JavaOne last year). Regular 'hot code replace' allows you to change the bodies of methods/constructors. With the agent you can do:
    - add/delete methods themselves
    - add/delete fields
    - add/delete constructors
    - change annotations on those things
    - change annotations on the type declarations

    The main limitation right now is that it doesn't allow you to alter the hierarchy of a type, you can't change the set of interfaces you implement or your superclass.

    Hope thats useful,

    cheers
    Andy
    ---
    Andy Clement
    SpringSource

  3. #3
    Join Date
    Apr 2011
    Posts
    3

    Default

    Hi Andy

    Thanks for your answer! Therefore this feature is really new isn't it?

    Okay, I've found the vm arguments in the tc Server run configuration:
    Code:
    -javaagent:"C:\springsource\sts-2.5.2.RELEASE\plugins\com.springsource.sts.server.tc.reloading_2.5.2.201101081000-RELEASE\lib\springloaded-0.5.1.jar" -noverify
    I would appreciate if you could answer the following questions:
    • Will this feature be turned into a commercial tool or is it intended to stay free to use?
    • Is there a plan for further development?
    • Will there be framework support such as done by JRebel?


    Thanks
    Claude

  4. #4
    Join Date
    May 2009
    Location
    Vancouver
    Posts
    274

    Default

    Hi Claude,

    > Will this feature be turned into a commercial tool or is it intended to stay free to use?

    Likely to remain free (although I'm not sure I'm qualified to answer this definitively!), not sure if STS will always be the ship vehicle though. Our current focus around the STS/tcServer dev experience means it is a nice way to ship it right now whilst we work out the kinks.

    > Is there a plan for further development?

    Yep, it is actively under development, it is now working for groovy code and the next release will be doing more with grails reloading.

    > Will there be framework support such as done by JRebel?

    Yep, if we want to support the kinds of apps users deploy on tc Server we need support for informing the frameworks about changes (e.g. spring/hibernate).

    cheers
    Andy

  5. #5
    Join Date
    Apr 2011
    Posts
    3

    Default

    Thank you Andy for the quick response.
    Looking forward to see this tool evolve.

    Claude

  6. #6

    Default

    doesnt work for me.
    How to change to another classloader?

  7. #7
    Join Date
    May 2009
    Location
    Vancouver
    Posts
    274

    Default

    Hi,

    What do you mean by 'change to another classloader'? If you are having an issue with the java agent based reloading, please raise an issue on the STS issuetracker: https://issuetracker.springsource.com/browse/STS and I'll take a look, please try to include context of what you are doing and the kind of program you are running that isn't reloading correctly.

    thanks
    Andy

  8. #8

    Angry javaagent sts bug

    I can't add my own javagent such as:
    -javaagent:${development.lib.dir}/class-reload-agent.jar=classes=${virtual.classpath};${frontend.classes.d ir},loglevel=INFO

    it wont take in sts.

    I would use your
    javaagent:"C:\dev\software\springsource\sts-2.6.1.SR1\plugins\com.springsource.sts.server.tc.r eloading_2.8.0.201110171000-RELEASE\lib\springloaded-1.0.1.jar"

    if it worked for me.

    Perhaps some documentation for the options/parms would be a good start...

  9. #9
    Join Date
    May 2009
    Location
    Vancouver
    Posts
    274

    Default

    Hi,

    The aim is that you don't need to use any options by default (for springloaded), and it usually will do the right thing - if it doesn't it is likely a bug. All options would be for advanced configuration only, and that is why there is no doc on them right now.

    To put your own agent there I'd recommend copying the launch configuration rather than trying to edit the one created for tc server by default, as that launch configuration is subject to rewriting when the server starts up as STS modifies it to contain the most up to date and correct information (this may override anything you are manually tweaking).

    > I would use your
    > javaagent:"C:\dev\software\springsource\sts-2.6.1.SR1\plugins\com.springsource.sts.server.tc.r eloading_2.8.0.201110171000-RELEASE\lib\springloaded-1.0.1.jar"
    > if it worked for me.

    What didn't work? If you raise a bug I can take a look at whatever it is.

    Andy

  10. #10

    Default

    my app just wont start using the springloaded<ver>.jar..
    seems to alter the classpath or something. I get a bunch of exceptions when I shouldn't.
    If I un-check the option, all is fine...

    If I cant update the server settings in sts, then what's the point of using the embedded server? BTW, if I alter any other setting, or add other entries, they stick. Just the javaagent doesnt seem to work.

    As per the options for the javaagent - where is the documentation? I have seen people use the options in unrelated posts (not this site)
    Thanks for the info though. Quite insightful.

Tags for this Thread

Posting Permissions

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