apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.42k stars 2.1k forks source link

Could not create script recorder - see log for details: Cannot find keytool application and no keystore was provided #5882

Open zcai2023 opened 1 year ago

zcai2023 commented 1 year ago

Expected behavior

Able to re-generate the Apache certificate successfully

Actual behavior

Run into this error "could not create script recorder - see log for details: Cannot find keytool application and no keystore was provided" when I hit the Start button in the Test Script Recorder

Steps to reproduce the problem

  1. Java JDK 20 and JMeter are installed on Windows 10
  2. Apache.JMeterTempraryRootCA certificate is missing from the apache-jmeter-5.5\bin after JMeter 5.5 is installed
  3. System path is set properly as %JAVA_HOME%\bin.
  4. "Java -version", "keytool" commands can run in CMD successfully to prove System path is ok
  5. I followed this video https://www.youtube.com/watch?v=p-Wv_QEVFg4&list=PLU62LFwq2qWHB7_9nBXVQyJ3vGKkW2zDN&index=9 to re-generate the certificate. However, after numerous attempts (including Java, JMeter reinstall, System Properties configuration), I always run into this error "could not create script recorder - see log for details: Cannot find keytool application and no keystore was provided" when I hit the Start button in the Test Script Recorder (see attached screenshot below)
  6. Logs are captured as below 2023-05-05 21:23:04,416 INFO o.a.j.s.FileServer: Default base='C:\Tools\apache-jmeter-5.5\bin' 2023-05-05 21:23:04,426 INFO o.a.j.g.a.Load: Loading file: C:\Users\caiz\Desktop\JMeter\HTTP(S) Test Script Recorder.jmx 2023-05-05 21:23:04,427 INFO o.a.j.s.FileServer: Set new base='C:\Users\caiz\Desktop\JMeter' 2023-05-05 21:23:04,985 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 2023-05-05 21:23:05,032 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0 2023-05-05 21:23:05,032 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8 2023-05-05 21:23:05,032 INFO o.a.j.s.SaveService: Loading file: C:\Users\caiz\Desktop\JMeter\HTTP(S) Test Script Recorder.jmx 2023-05-05 21:23:05,217 ERROR o.a.j.e.KeyToolUtils: Unable to find keytool application. Check PATH or define system property keytool.directory 2023-05-05 21:23:05,396 INFO o.a.j.s.FileServer: Set new base='C:\Users\caiz\Desktop\JMeter' 2023-05-05 21:23:13,248 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.' 2023-05-05 21:23:13,248 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.' 2023-05-05 21:23:13,310 ERROR o.a.j.p.h.p.ProxyControl: Could not initialise key store java.io.IOException: Cannot find keytool application and no keystore was provided at org.apache.jmeter.protocol.http.proxy.ProxyControl.initKeyStore(ProxyControl.java:1534) ~[ApacheJMeter_http.jar:5.5] at org.apache.jmeter.protocol.http.proxy.ProxyControl.startProxy(ProxyControl.java:527) ~[ApacheJMeter_http.jar:5.5] at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.startProxy(ProxyControlGui.java:623) ~[ApacheJMeter_http.jar:5.5] at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.actionPerformed(ProxyControlGui.java:463) ~[ApacheJMeter_http.jar:5.5] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) ~[?:?] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2314) ~[?:?] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:407) ~[?:?] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) ~[?:?] at com.github.weisj.darklaf.ui.button.DarkButtonListener.mouseReleased(DarkButtonListener.java:72) ~[darklaf-core-2.7.3.jar:2.7.3] at java.awt.Component.processMouseEvent(Component.java:6620) ~[?:?] at javax.swing.JComponent.processMouseEvent(JComponent.java:3398) ~[?:?] at java.awt.Component.processEvent(Component.java:6385) ~[?:?] at java.awt.Container.processEvent(Container.java:2266) ~[?:?] at java.awt.Component.dispatchEventImpl(Component.java:4995) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2324) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4827) ~[?:?] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) ~[?:?] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) ~[?:?] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2310) ~[?:?] at java.awt.Window.dispatchEventImpl(Window.java:2780) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4827) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:720) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:714) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:747) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:744) ~[?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) ~[?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) ~[?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) ~[?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) ~[?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ~[?:?]

Capture

JMeter Version

5.5

Java Version

jdk-20

OS Version

Windows 10 Enterprise OS build 19044.2846

FSchumacher commented 1 year ago

Well, JMeter can't find the keytool binary, as stated in the line: Unable to find keytool application. Check PATH or define system property keytool.directory

Have you looked at the path you mentioned, that there is a binary named keytool?

zcai2023 commented 1 year ago

@FSchumacher Thanks. I checked my Java folder. Yes, there is a keytool.exe in the Java/bin folder. PATH has been set properly. I could run keytool in CMD to prove PATH is working. I've attached all the screenshots below.

Capture1 Capture2 Capture3

zcai2023 commented 1 year ago

@FSchumacher I also tried to set the keytool.directory in system.properties (see attached screenshot below), but still no luck. I just got an extra line of error message in the log (attached below)

2023-05-06 08:14:29,225 ERROR o.a.j.e.KeyToolUtils: Cannot find keytool using property keytool.directory=C:/Program Files/Java/jdk-20/bin 2023-05-06 08:14:29,225 ERROR o.a.j.e.KeyToolUtils: Unable to find keytool application. Check PATH or define system property keytool.directory

Capture4