with default bshclient.jar in lib folder. java -jar lib/bshclient.jar localhost 9002 endurance.bsh Connecting to BSH server on localhost:9002 Reading responses from server ... BeanShell 2.0b5 - by Pat Niemeyer (pat@pat.net) Exception in thread "main" java.net.SocketException: Socket is closed ... disconnected from server. at java.net.Socket.shutdownOutput(Socket.java:1407) at org.apache.jmeter.util.BeanShellClient.main(BeanShellClient.java:79) with bshclient-2.3.3.jar from SOAPUI repository, it seems to be connected just fine. java -jar bshclient-2.3.3.jar localhost 9002 endurance.bsh Connecting to BSH server on localhost:9002 Reading responses from server ... BeanShell 2.0b5 - by Pat Niemeyer (pat@pat.net) bsh % Stepping up : 300 Setting property 'ThroughputPerMin' to '900'. ThroughputPerMin = 900 Tried on both linux and windows machine. java -version java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Odd. I'm sure that used to work. As a temporary workround for a script without parameters, try telnet localhost 9003 [The telnet server is http server + 1, and is actually what bshclient uses] This should produce the "bsh %" prompt. Then enter the following: source("../endurance.bsh"); If you make a mistake, press ";" to end the line. Probably best to use a separate window to compose the commands and copy/paste. Or you could try the http interface: http://localhost:9002/
Looks like this broke sometime after 2.7. So another work-round is to use the version of bshclient.jar from that release. URL: http://svn.apache.org/r1571290 Log: Can't trigger bsh script using bshclient.jar; socket is closed unexpectedly Bugzilla Id: 56182 Modified: jmeter/trunk/src/core/org/apache/jmeter/util/BeanShellClient.java jmeter/trunk/xdocs/changes.xml
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3328