JMeter 4 - can't execute jmeter-server in windows 7

懵懂的女人 提交于 2019-11-30 08:12:36

问题


I download latest JMeter 4,

As part of Remote Testing

To run JMeter in remote node, start the JMeter server component on all machines you wish to run on by running the JMETER_HOME/bin/jmeter-server (unix) or JMETER_HOME/bin/jmeter-server.bat (windows) script.

I try to execute jmeter-server.bat in windows 7 and got the following error:

Server failed to start: java.rmi.server.ExportException: Listen failed on port:
0; nested exception is:
        java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find
the file specified)
An error occurred: Listen failed on port: 0; nested exception is:
        java.io.FileNotFoundException: rmi_keystore.jks (The system cannot find
the file specified)
errorlevel=1

It seems that a file rmi_keystore.jks is missing. (I can't find it in JMeter folders)

In JMeter 3.3 jmeter-server.bat is working.

EDIT 1

after I execute create-rmi-keystore.bat it created rmi_keystore.jks, but I get other error:

Server failed to start: java.rmi.server.ExportException: Listen failed on port:
0; nested exception is:
        java.io.IOException: java.security.UnrecoverableKeyException: Cannot rec
over key
An error occurred: Listen failed on port: 0; nested exception is:
        java.io.IOException: java.security.UnrecoverableKeyException: Cannot rec
over key
errorlevel=1

error from log:

2018-02-11 12:09:13,916 ERROR o.a.j.e.DistributedRunner: Failed to create engine at 127.0.0.1
java.rmi.ConnectIOException: Exception creating connection to: 127.0.0.1; nested exception is: 
    java.io.IOException: java.security.UnrecoverableKeyException: Cannot recover key
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source) ~[?:1.8.0_25]
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source) ~[?:1.8.0_25]
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source) ~[?:1.8.0_25]
    at sun.rmi.server.UnicastRef.newCall(Unknown Source) ~[?:1.8.0_25]
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) ~[?:1.8.0_25]
    at org.apache.jmeter.engine.ClientJMeterEngine.getEngine(ClientJMeterEngine.java:70) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.engine.ClientJMeterEngine.<init>(ClientJMeterEngine.java:83) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.engine.DistributedRunner.createEngine(DistributedRunner.java:237) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.engine.DistributedRunner.getClientEngine(DistributedRunner.java:213) [ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.engine.DistributedRunner.init(DistributedRunner.java:93) [ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.RemoteStart.doAction(RemoteStart.java:80) [ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:88) [ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:70) [ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.ActionRouter$$Lambda$63/2068100669.run(Unknown Source) [ApacheJMeter_core.jar:4.0 r1823414]
    at java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue.access$400(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_25]
    at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_25]
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_25]
Caused by: java.io.IOException: java.security.UnrecoverableKeyException: Cannot recover key
    at org.apache.jmeter.rmi.SSLRMIClientSocketFactory.createSocket(SSLRMIClientSocketFactory.java:110) ~[ApacheJMeter_core.jar:4.0 r1823414]
    ... 28 more
Caused by: java.security.UnrecoverableKeyException: Cannot recover key
    at sun.security.provider.KeyProtector.recover(Unknown Source) ~[?:1.8.0_25]
    at sun.security.provider.JavaKeyStore.engineGetKey(Unknown Source) ~[?:1.8.0_25]
    at sun.security.provider.JavaKeyStore$JKS.engineGetKey(Unknown Source) ~[?:1.8.0_25]
    at java.security.KeyStore.getKey(Unknown Source) ~[?:1.8.0_25]
    at sun.security.ssl.SunX509KeyManagerImpl.<init>(Unknown Source) ~[?:1.8.0_25]
    at sun.security.ssl.KeyManagerFactoryImpl$SunX509.engineInit(Unknown Source) ~[?:1.8.0_25]
    at javax.net.ssl.KeyManagerFactory.init(Unknown Source) ~[?:1.8.0_25]
    at org.apache.jmeter.rmi.SSLRMIClientSocketFactory.createSocket(SSLRMIClientSocketFactory.java:103) ~[ApacheJMeter_core.jar:4.0 r1823414]
    ... 28 more
2018-02-11 12:09:24,368 INFO o.a.j.e.DistributedRunner: Failed to configure 127.0.0.1
2018-02-11 12:09:24,369 INFO o.a.j.e.DistributedRunner: Stopping remote engines
2018-02-11 12:09:24,370 INFO o.a.j.e.DistributedRunner: Remote engines have been stopped
2018-02-11 12:09:24,370 ERROR o.a.j.g.a.ActionRouter: Error processing org.apache.jmeter.gui.action.RemoteStart@3249a1ce
java.lang.RuntimeException: Following remote engines could not be configured:[127.0.0.1]
    at org.apache.jmeter.engine.DistributedRunner.init(DistributedRunner.java:112) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.RemoteStart.doAction(RemoteStart.java:80) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:88) [ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:70) [ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.gui.action.ActionRouter$$Lambda$63/2068100669.run(Unknown Source) [ApacheJMeter_core.jar:4.0 r1823414]
    at java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue.access$400(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_25]
    at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_25]
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) [?:1.8.0_25]
    at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_25]
    at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_25]

EDIT 2

I tried to change server.rmi.ssl.keystore.password to password I wrote but got a different error

Server failed to start: java.rmi.server.ExportException: Listen failed on port:
0; nested exception is:
        java.io.IOException: Keystore was tampered with, or password was incorre
ct
An error occurred: Listen failed on port: 0; nested exception is:
        java.io.IOException: Keystore was tampered with, or password was incorre
ct

EDIT 3

I tried to set the server port manually SET SERVER_PORT=1099 according to reference but still trying to listen through port 0

On Windows this can be done by: SET SERVER_PORT=


回答1:


To solve issue, you need to follow:

  • http://jmeter.apache.org/usermanual/remote-test.html#setup_ssl

The problem was the answer to first question when executing create-rmi-keystore

What is your first and last name?

I should have answered rmi as it the default value in JMeter's property server.rmi.ssl.keystore.alias

Also (difference from JMeter 3.3) I needed to change JMeter's property remote_hosts so that it uses my host name (change from 127.0.0.1)

This is related to :

  • https://bz.apache.org/bugzilla/show_bug.cgi?id=62039



回答2:


Had the same problem.

To solve it you have several options:

  1. Set rmi-keystore password to changeit, as described in jmeter.properties:

    Password of Trust store
    server.rmi.ssl.truststore.password=changeit

  2. If using custom password - add it to user.properties on jmeter-server machine

  3. Disable SSL by passing -Jserver.rmi.ssl.disable=true




回答3:


What worked for me (with JMeter 5.0) was an dedicated jmeter-server.properties file with this configurations:

# Type of keystore : JKS
server.rmi.ssl.keystore.type=JKS
#
# Keystore file that contains private key
server.rmi.ssl.keystore.file=rmi_keystore.jks
#
# Password of Keystore
server.rmi.ssl.keystore.password=changeit
#
# Key alias
server.rmi.ssl.keystore.alias=rmi
#
# Type of truststore : JKS
server.rmi.ssl.truststore.type=JKS
#
# Keystore file that contains certificate
server.rmi.ssl.truststore.file=rmi_keystore.jks
#
# Password of Trust store
server.rmi.ssl.truststore.password=changeit

I created a rmi_keystore.jks file with the create-rmi-keystore command in the JMeter bin folder. Then I started my server with jmeter-server -Gjmeter-server.properties. Also check then the log from the server to get the endpoint to connect your client with the server as user7294900 suggested.

Created remote object: UnicastServerRef2 [liveRef: [endpoint:[<this is your server>



回答4:


I faced all the above problems, until i found the solution to it, which is this:

  • The error java.security.UnrecoverableKeyException: Cannot recover key occurs when the keystore and keyEntry passwords are different.

  • To resolve this issue, you must remove all traces of the past certificate and request file.

  • You must generate a new keystore, keyEntry and CSR and specify the same password for the keystore and the keyEntry.



来源:https://stackoverflow.com/questions/48729987/jmeter-4-cant-execute-jmeter-server-in-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!