2

当我尝试运行 jmockit 的 maven 测试或 maven surefire 测试时,出现以下错误。但是当我运行 junit 或 testng 时,它工作正常。

java.lang.RuntimeException: java.io.IOException: Unable to enqueue operation, pre-6.0 jvm.dll? 在 mockit.internal.startup.JDK6AgentLoader.loadAgentAndDetachFromThisVM(JDK6AgentLoader.java: 111) 在 org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:111) 引起:java.io.IOException:无法入队操作,6.0之前的jvm.dll?在 sun.tools.attach.WindowsVirtualMachine.enqueue(Native Method) 在 sun.tools.attach.WindowsVirtualMachine.execute(WindowsVirtualMachine.java: 77) 在 sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java: 53)

以上是我在使用 maven 2.2 执行时遇到的错误。

我正在使用的环境: Maven:2.2.1 JMockit:0.999.11 在 pom 中添加如下:

<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-surefire-plugin</artifactId> 
<version>2.11</version> 
<configuration> 
<forkMode>once</forkMode> 
<argLine>-javaagent:"${settings.localRepository}"/com/googlecode/ 
jmockit/jmockit/0.999.11/jmockit-0.999.11.jar</argLine> 
<useSystemClassloader>true</useSystemClassloader> 
</configuration> 
</plugin> 

Java:IBM Java 1.6 SR4

但是当我将 javaagent 路径添加到 junit 或 testng 运行时 vm args 时,它运行良好。但是我尝试添加到 maven test vm args 但没有工作。

请帮我解决这个问题。

提前致谢。-斯里纳斯

4

0 回答 0