Jmeter: BeanshellAssertion Error: Method Not Found In Class - class

I simply want to read response from jdbc sampler and use it in an http request.
I created a BeanShellAssertion Script under a jdbc request and wrote just the below code, nothing else.
if(vars.getObjects("jdbcresult1").size!=0)
{
String jdbcresult1=vars.getObjects("jdbcresult1").get(0).get("jdbctrackingnumber1")+"";
vars.put("trackingnumber1",jdbcresult1);
log.info("TrackingNumber1 is: "+trackingnumber1);
}
Error:
2020-08-13 23:32:47,030 ERROR o.a.j.u.BeanShellInterpreter: Error
invoking bsh method: eval Sourced file: inline evaluation of: ``import
java.lang.Object; if(vars.getObjects("jdbcresult1").size!=0) {
String . . . '' : Error in method invocation: Method getObjects(
java.lang.String ) not found in
class'org.apache.jmeter.threads.JMeterVariables'
2020-08-13 23:32:47,030 WARN o.a.j.a.BeanShellAssertion: Error in
BeanShellAssertion
Question1: How do you decide what should you use to write a code to read jdbcresponse value:
a. beanshellassertion
b. beanshellpostprocessor
c. beanshelllistener
Question2: Solution to the original problem, to resolve the error ?

The problem is that:
vars.getObjects(...)
does not exist.
It should be :
vars.getObject(...)
See:
https://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterVariables.html
Also it’s better to use JSR223 Assertion:
https://jmeter.apache.org/usermanual/component_reference.html#JSR223_Assertion

Related

Tanka - VS Code - "Unexpected type string" while getting namespace from spec file

I'm trying out Tanka for k8s configs generation. Also, I'm using VS Code extension by Grafana Labs.
I've problems in VS Code with referencing Tanka configuration as described here. I'm using configuration to retrieve namespace, like so:
local k = import 'k.libsonnet';
local tk = import 'tk';
{
namespace: k.core.v1.namespace.new(tk.env.spec.namespace),
}
Initially, I was receiving an error: RUNTIME ERROR: Undefined external variable: tanka.dev/environment. I supposed that Tanka wants path to my environment, and so added it to VS Code settings:
{
"jsonnet.languageServer.extVars": {
"tanka.dev/environment": "environments/default"
}
}
Now I'm receiving another error in the k.core.v1.namespace.new(tk.env.spec.namespace) expression:
RUNTIME ERROR: Unexpected type string, expected number
<path to repo>/environments/default/main.jsonnet:7:38-49
<path to repo>/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.25/_gen/core/v1/namespace.libsonnet:51:35-39 thunk from <function <anonymous>>
<path to repo>/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.25/_gen/core/v1/namespace.libsonnet:33:42-46 object <anonymous>
Field "name"
Field "metadata"
Field "namespace"
During manifestation
The error is quite confusing to me. What and where expects number?
both namespace and name are strings in my spec.json
according to the same configuration docs they should be strings
on line 33 of namespace.libsonnet there is a function withName which expects name argument of type d.T.string
tk works fine from the CLI
I suppose that I've set wrong tanka.dev/environment, but I can't find docs that say what should be set there.
Also, just to check if it helps, I tried setting "jsonnet.languageServer.tankaMode": true in VS Code settings to no avail.
Please, help me to resolve the error and if possible explain what's going on here.

Error in alfresco bpm activiti: "bpm_assignees" is not defined

I have the next error when I try to execute an activii workflow:
org.alfresco.scripts.ScriptException: 02190005 Failed to execute
supplied script: 02190004 ReferenceError: "bpm_assignees" is not
defined. (AlfrescoJS#3)
In my process I don´t use that variable. I'm using bpm_group_assignee, no bmp_assignees, so I don't understand why.

Cannot recognize char '!' while using topredicate in BAP

I tried to use topredicate tool in bap to translate il to SMT-LIB2.
But this command returns an error:
./topredicate -il test.il -post "R_EBP:u32 != R_ESP:u32 -solver z3 -noopt -stp-out test.smt
The error is:
A parsing exception occured while parsing "!" Fatal error: exception Lexer.LexError(line 1: Unrecognized char '!')"
Does anybody know what happened? How can I solve the problem?
PS. Anybody knows how to configure z3 in BAP? It really confuses me that it can't work while I configure it by following INSTALL.
This is really a BAP issue, it looks to me that it doesn't get all the way to an SMT solver yet. Could it be that there is a " missing just before -solver?
-post "R_EBP:u32 != R_ESP:u32"

Mongoose websocket won't run

I'm following Mongoose webserver on Github (https://github.com/cesanta/mongoose) and I want to test the websocket sample code.
Here are the codes that I copied:
Unfortunately when I run the code, it returns the following errors:
websocket.obj : error LNK2001: unresolved external symbol _find_embedded_file
C:\ProjectFolder\WebsocketDemo.exe : fatal error LNK1120: 1 unresolved externals
Did I miss something?
The makefile of the examples explain what is missing
There is a rule that generate websocket_html.c that embeded the websocket.html inside a c file (it defines the missing find_embedded_file function).
websocket_html.c: websocket.html
perl mkdata.pl $< > $#
If you prefer to give access to the websocket.html file, this could be done modifying the websocket.c sample
Setting the document_root option
mg_set_option(server, "document_root", ".");
Not handle the html url in the user handler
static int send_reply(struct mg_connection *conn) {
if (conn->is_websocket) {
...
} else {
return MG_FALSE; // mongoose will open file specified by the url
}
}

DOMDocument cannot parse XML: DOMDocument::loadXML()

When I am executing the code below:
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');
$client = Zend_Gdata_ClientLogin::getHttpClient("amdminuser", "adminpsw", Zend_Gdata_Gapps::AUTH_SERVICE_NAME);
$client->createUser($username, $givenName, $familyName, $password, $passwordHashFunction=null, $quota=null)
it gives error:
Fatal error: Call to undefined method Zend_Gdata_HttpClient::createUser() in ....
Then we run the installation checker but it showed us this error:
Fatal error: Uncaught exception 'Zend_Gdata_App_Exception' with message 'DOMDocument cannot parse XML: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1' in /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata/App.php:830 Stack trace: #0 /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata/App.php(789): Zend_Gdata_App::importString('importUrl('https://gdata.y...', 'Zend_Gdata_YouT...', NULL) #2 /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata.php(162):
I have downloaded http://packages.zendframework.com/releases/ZendGdata-1.12.0/ZendGdata-1.12.0.zip, installed and set appropriate include_path in php.ini. However, I don't know why I am getting this problem and errors. Does anyone know why this is happening?
Thank you for your help.
createUser is a method of Zend_Gdata_Gapps class. Zend_Gdata_ClientLogin::getHttpClient returns an Zend_Gdata_HttpClient object.
Are you sure you've read the manual?