1

Newly back to using Jmeter after a 3 year break and pretty confused by this error.

I have a JSR223 Preprocessor which is used for generating AWS signatures and it keeps generating errors of the following type:

021-10-20 13:47:40,101 ERROR o.a.j.m.JSR223PreProcessor: Problem in JSR223 script, Create AWS Signature 
javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.apache.jmeter.protocol.java.sampler.JSR223Sampler.getMethod() is applicable for argument types: () values: []
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:158) ~[groovy-jsr223-3.0.7.jar:3.0.7]
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[java.scripting:?]

It's not causing the tests themselves to fail (weirdly) but it would be useful to stop these errors clogging our log files.

Help?!

Tufty
  • 475
  • 8
  • 24

2 Answers2

0

It looks like you added the JSR223 PreProcessor as a child of the JSR223 Sampler which doesn't really have getMethod() function.

The function is available for HTTPSamplerBase class and derivatives.

In other words you need to put the JSR223 Preprocessor as a child of the HTTP Request sampler and it should start working as expected.

More information: How to Handle Dynamic AWS SigV4 in JMeter for API Testing

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

Make sure you uncheck checkbox on JSR223 Sampler >> Cache compiled script if available. It looks like script is cached and not recompiled, resulting in old code being run. Also make sure your old code is not hidden in the bottom of script editor window (scrollbar sometimes does not display correctly how much content is hidden).

Mitja Gustin
  • 1,723
  • 13
  • 17