尝试将测试计划保存在JMeter中时出现以下错误:无法保存到文件(拒绝访问) 谁能帮我?
日志跟踪是这样的:
ERROR o.a.j.g.a.Save: Failed to backup file : C:\Program Files
(x86)\Sisteplant\LoadTests\TestDefinitions\HandlingUnitStateChangeSimulation.jmx
java.io.FileNotFoundException: C:\Program Files
(x86)\Sisteplant\LoadTests\JMeter\backups\HandlingUnitStateChangeSimulation-000001.jmx (Acceso
denegado)
at java.io.FileOutputStream.open0(Native Method) ~[?:1.8.0_191]
at java.io.FileOutputStream.open(Unknown Source) ~[?:1.8.0_191]
at java.io.FileOutputStream.<init>(Unknown Source) ~[?:1.8.0_191]
at java.io.FileOutputStream.<init>(Unknown Source) ~[?:1.8.0_191]
at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1142) ~[commons-io-2.5.jar:2.5]
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1088) ~[commons-io-2.5.jar:2.5]
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1040) ~[commons-io-2.5.jar:2.5]
at org.apache.jmeter.gui.action.Save.createBackupFile(Save.java:378) ~[ApacheJMeter_core.jar:3.2
r1790748]
at org.apache.jmeter.gui.action.Save.doAction(Save.java:209) ~[ApacheJMeter_core.jar:3.2 r1790748]
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:74) ~
[ApacheJMeter_core.jar:3.2 r1790748]
at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:59) ~
[ApacheJMeter_core.jar:3.2 r1790748]
at java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_191]
at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_191]
at java.awt.EventQueue.access$500(Unknown Source) [?:1.8.0_191]
at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_191]
at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_191]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_191]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
[?:1.8.0_191]
at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_191]
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_191]
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_191]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_191]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_191]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_191]
at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_191]
非常感谢
答案 0 :(得分:0)
很可能您的用户没有C:\Program Files (x86)
文件夹的写权限,因此您遇到此错误。
选择其他位置(您绝对具有对主文件夹的写权限)
另一个选择是run JMeter as administrator,这样您就可以摆脱WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0
错误,从而解锁一些自定义持久性。
另外请注意,根据9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure文章,您应该始终使用最新版本的JMeter,因此请考虑升级到JMeter 5.3(或{{3 }}页)。