Automated Exception Handling

前端 未结 4 1656
無奈伤痛
無奈伤痛 2021-02-03 12:44

I was wondering if something exists (in Java world) able to take an snapshot of the JVM current state with the following features:

  • Do it while an exception is bein
相关标签:
4条回答
  • 2021-02-03 13:28

    You may want to look into the work that NetBeans has done regarding automated use logging: http://wiki.netbeans.org/UsageLoggingSpecification.

    As for dumping out local variables, I would imagine that you could simply use a debugger, such as the one that bajafresh4life mentioned.

    0 讨论(0)
  • 2021-02-03 13:37

    I give a look to JavaFrame and it seems a good starting point. Just install Apache Ant, do ant in the javaframe directory and launch the test suite (inside test directory) with:

    LD_LIBRARY_PATH=../build/native/ java -agentlib:frameintrospect -classpath ../build/classes/:. org.thobe.frame.Test
    

    It does not get any local variable but it tries. So, as I said, it can be an starting point. I hope to get further about its usage, but no time and no documentation (there are lots of projects named JavaFrame) are bad circumstances.

    Maybe some day it can be done again. Yes, again. There was Cajoon, it looked promising and shiny but its website is down and there is no trace of any downloadable jar to try.

    Thanks to everybody!

    PD.: Just for reference, some links I found while researching:

    • How VM Agents Work
    • JVM options
    0 讨论(0)
  • 2021-02-03 13:39

    Not sure if this is viable in a production environment, but there's the Omniscient debugger:

    What if your debugger could go "go backwards in time?" Would that make debugging easier? By simply recording all variable assignments, it is possible to do essentially this. This is the underlying idea for omniscient debugging. The amazing part is that significantly large programs can be debugged in this fashion -- Ant, JUnit, the debugger itself.

    http://www.lambdacs.com/debugger/

    0 讨论(0)
  • 2021-02-03 13:45

    Maybe it could be done with AspectJ?

    0 讨论(0)
提交回复
热议问题