Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in recorder.bsf #42

Closed
jgupta opened this issue Jan 13, 2014 · 18 comments
Closed

Error in recorder.bsf #42

jgupta opened this issue Jan 13, 2014 · 18 comments
Labels

Comments

@jgupta
Copy link

jgupta commented Jan 13, 2014

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
Copy link
Contributor

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
Copy link
Author

jgupta commented Jan 13, 2014

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
Copy link
Contributor

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

dmonllao pushed a commit to dmonllao/moodle-performance-comparison that referenced this issue Jan 13, 2014
… as the current StringUtils has been deprecated
@jgupta
Copy link
Author

jgupta commented Jan 13, 2014

Thank you. It works well with jmeter 2.9.

@dmonllao
Copy link
Contributor

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

@dmonllao
Copy link
Contributor

@dmonllao
Copy link
Contributor

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

dmonllao pushed a commit to dmonllao/moodle-performance-comparison that referenced this issue Jan 14, 2014
… as the current StringUtils has been deprecated
dmonllao pushed a commit to dmonllao/moodle-performance-comparison that referenced this issue Jan 14, 2014
… as the current StringUtils has been deprecated
@onno-schuit
Copy link

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
Copy link

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
Copy link

alendit commented Jan 9, 2015

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
Copy link

Hello Dimitri,

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

@tHeSmUrF
Copy link

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
Copy link

Thanks for reporting this @tHeSmUrF

Will check this ...

@dmonllao dmonllao reopened this Feb 20, 2015
@dmonllao
Copy link
Contributor

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:

  • Ubuntu 14.04
  • OpenJDK "1.7.0_75"
  • I've tried with JMeter 2.9, 2.11 and 2.12

Just a few questions?

  • Do you experience the same problem if you just run ./compare.sh?
  • Are you overwriting any defaults.properties value?

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

@dmonllao dmonllao added the bug label Feb 20, 2015
@bodypheo
Copy link

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
Copy link

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
Copy link
Member

stronk7 commented Jun 20, 2021

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 :-)

@stronk7 stronk7 closed this as completed Jun 20, 2021
@bodypheo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants