What I try to do:
I build a java service that load a testplan and run that one. I'm not using any Bash scripts and jmeter GUI. The java App is built as a service so that can run in the cloud. The Idea is, just to create some diameter Traffic data.
When I run the src on intellij (locally), all works fine.
Starting the app, all OK.
java -jar -Dserver.port=8090 diameter-service-0.0.1-SNAPSHOT.jar
Run REST request:
localhost:8090/api/v1/encode
after the request I get following error:
java.io.FileNotFoundException: file:/Users/myuser/Downloads/diameter-service-0.0.1-SNAPSHOT.jar!/jmeter/bin/saveservice.properties (No such file or directory)
The first thing what I checked was jMeter Home. system out on console:
HOME: file:/Users/myuser/Downloads/diameter-service-0.0.1-SNAPSHOT.jar!/jmeter
The files are also available and located under bin, and slo in the class path.
/src/main/resources/jmeter/bin/saveservice.properties
/src/main/resources/jmeter/bin/jmeter.properties
/src/main/resources/jmeter/bin/user.properties
I think the jMeter Home path is OK. ..or is that a wrong presumption? Way jMeter can not load the saveservice.properties?
Is that because jmeter try to open the file with the FILE Class? How can java load the saveservice.properties? or is that not necessary because jMeter Home is set?
private static final String jMeterHomePath = "/jmeter";
private static final String jMeterPropertiesFile = jMeterHomePath + "/bin/jmeter.properties";
...
File propertiesFile = FileStreamUtil.jMeterPropertiesToTempFile(jMeterPropertiesFile);
String jMeterPropertiesPath = propertiesFile.getPath();
StandardJMeterEngine jMeter = new StandardJMeterEngine(); JMeterUtils.setJMeterHome(Encoder.class.getResource(jMeterHomePath).getPath());
JMeterUtils.loadJMeterProperties(jMeterPropertiesPath);
JMeterUtils.initLogging();
JMeterUtils.initLocale();
String home = JMeterUtils.getJMeterHome();
System.out.println("HOME: "+home);
SaveService.loadProperties();
jmeter/bin/saveservice.properties
in a classpath dir or at the root of the jar – davidxxx