Search code examples
javajmeterdistributed-testing

How to fix java.io.NotSerializableException: org.apache.jmeter.JMeter$ListenToTest in JMeter?


I'm trying to do distributed tests using JMeter 5.1.1. I used manual from here, but have problem with specifying port for connection from server(slave) to client(master). When I'm using client.rmi.localport in jmeter.properties on master the following error appears:

ERROR o.a.j.u.JMeterUtils: Error in rconfigure() method java.rmi.MarshalException: error marshalling arguments; nested exception is: java.io.NotSerializableException: org.apache.jmeter.JMeter$ListenToTest

I was able to manage with other ports, only this one gives me trouble. I'm using nonGUI mode. How can I fix this/specify port?

Logs from master:

[...]

ERROR o.a.j.e.ConvertListeners: RemoteException occurred while replacing Remotable item. java.rmi.server.ExportException: Listen failed on port: 4453; nested exception is: java.io.IOException: Could not bind to XXX/XXX.XXX.XXX.XXX using port 4453

[...]

Caused by: java.io.IOException: Could not bind to XXX/XXX.XXX.XXX.XXX using port 4453 at org.apache.jmeter.rmi.SSLRMIServerSocketFactory.createServerSocket(SSLRMIServerSocketFactory.java:139) ~[ApacheJMeter_core.jar:5.1.1 r1855137] at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(Unknown Source) ~[?:1.8.0_231] ... 22 more Caused by: java.net.BindException: Address already in use: JVM_Bind

[...]

ERROR o.a.j.e.ClientJMeterEngine: Error in rconfigure() method java.rmi.MarshalException: error marshalling arguments; nested exception is: java.io.NotSerializableException: org.apache.jmeter.JMeter$ListenToTest at sun.rmi.server.UnicastRef.invoke(Unknown Source) ~[?:1.8.0_231]

[...]

jmeter.properties on master:

[...]

remote_hosts=XXX.XXX.XXX.XXX:4454

[...]

client.rmi.localport=4451

[...]

jmeterengine.nongui.port=4448

[...]

Edit: Changed JMeter to version 5.2 due to problem in comments.


Solution

  • Disabling the secure channel among client and servers helped me - I had this error no more and could specify ports. However I suggest doing it ONLY if your environment (both client and servers) work in private network.