Reputation: 1
My class path looks like below in jar and trying to load class in JMeter BeanShell Sampler and my java version is Java8 but getting error
C:\Jars\saturn-event-bridge-1.1.2-SNAPSHOT.jar\BOOT-INF\classes\com\rbs\ccr\saturn\eventbridge\constants\
Beanshell script:
package BOOT-INF.classes.com.rbs.ccr.saturn.eventbridge.constants.EventBridgeConstants;
EventBridgeConstants constant = new EventBridgeConstants();
a=constant.toString();
System.out.println(a);
But when i run script in Jmeter version 3.2 getting below error
Error: Response code: 500 Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``package BOOT-INF.classes.com.rbs.ccr.saturn.eventbridge.constants.EventBridgeCon . . . '' : Class or variable not found: INF.classes.com.rbs.ccr.saturn.eventbridge.constants.EventBridgeConstants
Is my script is correct for loading java class in JMeter. Please help here
Can you help me resolving issue
Upvotes: 0
Views: 34
Reputation: 168207
Copy saturn-event-bridge-1.1.2-SNAPSHOT.jar
and all its dependencies if any to "lib" folder of your JMeter installation or amend user.classpath property to point to the folder where your .jars are located
Restart JMeter to pick the .jar(s) up
Change first line to look like:
import com.rbs.ccr.saturn.eventbridge.constants.EventBridgeConstants;
Your script should start working normally
Also consider:
Upvotes: 0