Can not attach the jmockit.jar on a springboot application with standalone mode #372

Open
gengcheng opened this Issue Dec 17, 2016 · 0 comments

Projects

None yet

1 participant

@gengcheng
gengcheng commented Dec 17, 2016 edited

Please provide the following information:

  • Version of JMockit that was used: 1.29

  • Description of the problem or enhancement request:

  1. running jmockit.jar on a springboot process:
    java -jar jmockit-1.29.jar 13113

  2. the jmockit output:
    Exception in thread "main" java.lang.IllegalStateException: com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute at mockit.internal.startup.AgentLoader.loadAgentAndDetachFromRunningVM(AgentLoader.java:163) at mockit.internal.startup.AgentLoader.loadAgent(AgentLoader.java:63) at mockit.coverage.CodeCoverage.main(CodeCoverage.java:33) Caused by: com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:117) at mockit.internal.startup.AgentLoader.loadAgentAndDetachFromRunningVM(AgentLoader.java:159) ... 2 more

if we starting the springboot application with jmockit.jar as javaagent, like this:
java -jar -javaagent:~/jmockit-1.29.jar=standalone,-Dcoverage-outputDir=~/coverage -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=256m -Dspring.profiles.active=linxuan test.jar

the springboot application can be accessed but we can not get the coverage report after killing the application instance on the ~/coverage folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment