On Wednesday 08 February 2006 17:19, sebb wrote: > > You need to quote commas in function calls - commas are used to > delimit function parameters. > > See Section 9.3 in: > > http://jakarta.apache.org/jmeter/usermanual/functions.html >
Managed to miss that, a matching example in Section 19.5.13 would have helped. > Try: > > ${__BeanShell(return > java.net.URLEncoder.encode(vars.get("${viewstate}")\,"UTF-8"); )} > Got the following error: 2006/02/08 17:41:01 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method eval java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:136) at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:172) at org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:114) at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:125) at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:93) at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:85) at org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsString(AbstractTestElement.java:195) at org.apache.jmeter.config.Argument.getValue(Argument.java:121) at org.apache.jmeter.protocol.http.util.HTTPArgument.getEncodedValue(HTTPArgument.java:140) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getQueryString(HTTPSamplerBase.java:430) at org.apache.jmeter.protocol.http.sampler.HTTPSampler.setupConnection(HTTPSampler.java:157) at org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:422) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:514) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:503) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:247) at java.lang.Thread.run(Unknown Source) Caused by: Sourced file: inline evaluation of: ``return java.net.URLEncoder.encode(vars.get(""),"UTF-8"); ;'' : Method Invocation java.net.URLEncoder.encode : at Line: 1 : in file: inline evaluation of: ``return java.net.URLEncoder.encode(vars.get(""),"UTF-8"); ;'' : java .net .URLEncoder .encode ( vars .get ( "" ) , "UTF-8" ) Target exception: java.lang.NullPointerException at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHReturnStatement.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) ... 20 more 2006/02/08 17:41:01 WARN - jmeter.functions.BeanShell: Error running BSH script org.apache.jorphan.util.JMeterException: Error invoking bsh method eval at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:147) at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:172) at org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:114) at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:125) at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:93) at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:85) at org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsString(AbstractTestElement.java:195) at org.apache.jmeter.config.Argument.getValue(Argument.java:121) at org.apache.jmeter.protocol.http.util.HTTPArgument.getEncodedValue(HTTPArgument.java:140) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getQueryString(HTTPSamplerBase.java:430) at org.apache.jmeter.protocol.http.sampler.HTTPSampler.setupConnection(HTTPSampler.java:157) at org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:422) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:514) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:503) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:247) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:136) ... 15 more Caused by: Sourced file: inline evaluation of: ``return java.net.URLEncoder.encode(vars.get(""),"UTF-8"); ;'' : Method Invocation java.net.URLEncoder.encode : at Line: 1 : in file: inline evaluation of: ``return java.net.URLEncoder.encode(vars.get(""),"UTF-8"); ;'' : java .net .URLEncoder .encode ( vars .get ( "" ) , "UTF-8" ) Target exception: java.lang.NullPointerException at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHReturnStatement.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) ... 20 more 2006/02/08 17:41:01 ERROR - jmeter.protocol.http.sampler.HTTPSampler: java.io.IOException: Server returned HTTP response code: 500 for URL: http://192.168.254.215/Login/Login.aspx 2006/02/08 17:41:01 ERROR - jmeter.protocol.http.sampler.HTTPSampler: <html> <head> <title>Value was invalid.</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style> </head> <body bgcolor="white"> <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1> <h2> <i>Value was ... -- Qmediastream http://qmediastream.com design, commerce, hosting, streaming, multimedia --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]