Sanket Dhamale
Sanket Dhamale

Reputation: 1

Not able to run beanshell file for pgp encryption with jmeter for all the request "

I have created benshell code below to enctrypt the json request in jmeter after running give below error message

Error message : Response code:500 Response message:org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import org.bouncycastle.openpgp.*; import org.bouncycastle.openpgp.operator.jcaj . . . '' : Unknown class: BouncyCastleProvider

enter image description here

i have Verify Bouncy Castle JAR Files and added added into jmeter/ lib folder Ensure you have the correct Bouncy Castle JAR files: Download the JAR Files: You need at least the following JAR files for PGP functionality: bcprov-jdk15on-1.69.jar (or a newer version) bcpkix-jdk15on-1.69.jar (if you are using PGP features)

Upvotes: 0

Views: 30

Answers (1)

Ivan G
Ivan G

Reputation: 2707

First of all you need to restart JMeter to pick up any changes in JMeter Classpath.

Also be informed that using Beanshell is some form of a performance anti-pattern especially when it comes to "heavy" operations like cryptography.

Since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language for scripting.

More information:

  1. Apache Groovy: What Is Groovy Used For?
  2. Encryption and decryption with Groovy -> Using the Bouncy Castle library

Upvotes: 0

Related Questions