moodlehq / moodle-performance-comparison

Set of shell scripts to run Moodle performance tests using different hardware and configurations and compare results.
GNU General Public License v2.0
75 stars 39 forks source link

Error in recorder.bsf #42

Closed jgupta closed 3 years ago

jgupta commented 10 years ago

Using Centos 6.4 64-bit java version 1.7.0_45 apache-jmeter-2.11

-------------ERROR LOG-------------- 2014/01/13 00:54:49 INFO - jmeter.threads.JMeterThread: Thread started: Moodle Test 2-3 2014/01/13 00:54:49 INFO - jmeter.threads.ThreadGroup: Started thread group number 2 2014/01/13 00:54:49 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started 2014/01/13 00:54:50 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: source Sourced file: recorder.bsf : Typed variable declaration : Typed variable declaration : Attempt to resolve method: rightPad() on undefined variable or class name: StringUtils 2014/01/13 00:54:50 WARN - jmeter.visualizers.BeanShellListener: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: source Sourced file: recorder.bsf : Typed variable declaration : Typed variable declaration : Attempt to resolve method: rightPad() on undefined variable or class name: StringUtils 2014/01/13 00:54:50 INFO - jmeter.threads.JMeterThread: Thread started: Moodle Test 2-4 2014/01/13 00:54:50 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: source Sourced file: recorder.bsf : Typed variable declaration : Typed variable declaration : Attempt to resolve method: rightPad() on undefined variable or class name: StringUtils 2014/01/13 00:54:50 WARN - jmeter.visualizers.BeanShellListener: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: source Sourced file: recorder.bsf : Typed variable declaration : Typed variable declaration : Attempt to resolve method: rightPad() on undefined variable or class name: StringUtils 2014/01/13 00:54:50 INFO - jmeter.threads.JMeterThread: Thread started: Moodle Test 2-5 2014/01/13 00:54:50 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: source Sourced file: recorder.bsf : Typed variable declaration : Typed variable declaration : Attempt to resolve method: rightPad() on undefined variable or class name: StringUtils 2014/01/13 00:54:50 WARN - jmeter.visualizers.BeanShellListener: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: source Sourced file: recorder.bsf : Typed variable declaration : Typed variable declaration : Attempt to resolve method: rightPad() on undefined variable or class name: StringUtils 2014/01/13 00:54:50 INFO - jmeter.threads.JMeterThread: Thread started: Moodle Test 2-6

dmonllao commented 10 years ago

Hi @jgupta,

The exception references an undefined class name StringUtils, so there are dependencies that are not satisfied.

Ensure you downloaded the JMeter binaries through http://jmeter.apache.org/download_jmeter.cgi rather than using a packaging management system as specified in https://github.com/moodlehq/moodle-performance-comparison/blob/master/README.md#requirements

I'm leaving the ticket opened until you confirm that that was the problem.

jgupta commented 10 years ago

Thanks for replying.

I did installed jmeter from that link. We used exactly following URL http://www.dsgnwrld.com/am//jmeter/binaries/apache-jmeter-2.11.zip

dmonllao commented 10 years ago

Thanks for the report @jgupta I've just confirmed that there is an issue with the latest JMeter version (2.11)

I see that commons-lang-2.6.jar, which contains the StringUtils version we are using is not included in JMeter 2.11; quickly switching recorder.bsf and recorderfunctions.bsf to use org.apache.commons.lang3.StringUtils instead of org.apache.commons.lang.StringUtils fixes the problem for me, but we need to be sure about it before integrating the patch.

Until we test and integrate a solution for this, please use the JMeter 2.9 version, which includes commons-lang-2.6.jar. You can download it from the JMeter archives:

http://archive.apache.org/dist/jmeter/binaries/ -> apache-jmeter-2.9.tgz

jgupta commented 10 years ago

Thank you. It works well with jmeter 2.9.

dmonllao commented 10 years ago

Info about why it was removed: http://jmeter.apache.org/changes_history.html#Incompatible%20changes (last point)

dmonllao commented 10 years ago

I've been comparing both APIs and it seems that there are no significant differences, only that lang3 is for Java 5 onwards:

http://tomjefferys.blogspot.com.au/2012/01/stringutils-so-thought-itd-be-good-to.html

Merging changes in master, 25 and 26

dmonllao commented 10 years ago

Also we are only using StringUtils.rightPad() so it is safe to switch

onno-schuit commented 10 years ago

Using JMeter 2.9 r1437961 with a test plan generated by Moodle 2.7 does work for me, but it generates this error (pretty much continuously): "jmeter.visualizers.BeanShellListener: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method". Using JMeter 2.11 produces the same results.

java version "1.7.0_65" OpenJDK Runtime Environment (IcedTea 2.5.2) (7u65-2.5.2-3~14.04) OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode) Ubuntu 14.04 (64 bits)

rajeshtaneja commented 10 years ago

Hello onno,

Can you please check jmeter dependencies are correctly installed. Please refer https://github.com/moodlehq/moodle-performance-comparison/blob/master/TROUBLESHOOTING.md (Requirements -> JMeter dependencies) for more information.

alendit commented 9 years ago

Same error as @onno-schuit , both with JMeter 2.9 and 2.11 (java version "1.7.0_45").

2015/01/09 14:48:37 INFO  - jmeter.threads.JMeterThread: Thread started: Moodle Test 2-1 
2015/01/09 14:48:38 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: source Sourced file: recorder.bsf 
2015/01/09 14:48:38 WARN  - jmeter.visualizers.BeanShellListener: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: source        Sourced file: recorder.bsf 
2015/01/09 14:49:10 INFO  - jmeter.threads.JMeterThread: Thread finished: Moodle Test 2-1 

So no idea what the error is exactly.

rajeshtaneja commented 9 years ago

Hello Dimitri,

Have you downloaded the binaries from http://jmeter.apache.org/download_jmeter.cgi rather than using a package management system.

tHeSmUrF commented 9 years ago

Same error as what others have reported "jmeter.visualizers.BeanShellListener: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: source Sourced file".

I've tried JMeter 2.12 and 2.9.

Running JDK 1.8.0.31

rajeshtaneja commented 9 years ago

Thanks for reporting this @tHeSmUrF

Will check this ...

dmonllao commented 9 years ago

Hi @onno-schuit @alendit @tHeSmUrF,

The previous error this issue was solving was pretty clear, a change from lang to lang3, this seems to be a different issue.

I couldn't replicate the problem, I've tried using:

Just a few questions?

Resuming, do you always experience the same issue or only under specific conditions? TIA

bodypheo commented 3 years ago

Hi all, I am still having this error with apache-jmeter when running the moodle test-plan. 2021-06-15 11:09:44,616 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: source /home/xxx/apache-jmeter-5.4.1/bin/recorder.bsf (No existe el fichero o el directorio) (file or directory does not exist) recorder.bsf does not exist aI downloaded a 5.2.x with same result Can this be fixed somehow? I downloaded the jmeter tar from apache jmeter directly not from package manager. Any ideas?

Thanks Kind regards

bodypheo commented 3 years ago

Hi again, after some trials and errors, (monkey behind keyboard), I have been able to run the tests changing this: In Test Plan tree-> Moodle test -> Create php array results -> in scrpt file name on Beanshell listener, changed recorder.bsf for the path to file: apache-jmeter-5.4.1/bin/BeanShellFunction.bshrc Apparently it is working now, it is running the test and it is doing all the test, getting page courses, discussions etc. Cheers

stronk7 commented 3 years ago

Hi,

I'm closing this as far as the original problem reported here was fixed long, long ago.

@bodypheo , I'm no sure that changing recorder.bsf by apache-jmeter-5.4.1/bin/BeanShellFunction.bshrc is a valid solution. That recorder is in charge of extracting important information from Moodle pages (files included, db operations...) and switching to another recorder doesn't sound like a correct solution (all that information will be missed).

I've seen that you're using Jmeter 5.x... I'd suggest you to try with older versions (we are actively using Jmeter 2.9 (and 2.11) in our infrastructure. Maybe that's enough to get the Moodle plan (and results) running ok.

I'd recommend you to continue @ #71 where another problem with recent JMeter version has been reported. There is a link to the old JMeter binaries there.

Now, as said, closing this, ciao :-)

bodypheo commented 3 years ago

@stronk7 Thank you very much for your insights, I will take a look at what you suggest.