Unlike the Beanshell Sampler, the BeanShell function does not accept input from a file.
Have a look at Function Help; the two parameters are: * the expression to evaluate * the name of the function. A file name is not normally also valid as a java expression ... I leave as an exercise for the reader to find one! S. ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 22, 2004 7:12 AM Subject: Error trying to use the __BeanShell function > > I am trying to fill in a HTTP Post parameter using some java code via a > BeanShell script. I receive the following error when the code executes. > > 2004/06/21 22:26:17 WARN - jmeter.functions.BeanShell: > java.lang.reflect.InvocationTargetException > at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .jav > a:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.apache.jmeter.functions.BeanShell.execute(BeanShell.java:107) > at > org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java :150 > ) > at > org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java :113 > ) > at > org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(Funct ionP > roperty.java:99) > at > org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsString(Abstra ctTe > stElement.java:234) > at org.apache.jmeter.config.Argument.getValue(Argument.java:120) > at > org.apache.jmeter.protocol.http.util.HTTPArgument.getEncodedValue(HTTPArgume nt.j > ava:160) > at > org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getQueryString(HTTPS ampl > erBase.java:483) > at > org.apache.jmeter.protocol.http.sampler.HTTPSampler.setupConnection(HTTPSamp ler. > java:180) > at > org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java: 465) > > at > org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBa se.j > ava:585) > at > org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBa se.j > ava:573) > at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254) > at java.lang.Thread.run(Thread.java:534) > Caused by: Sourced file: inline evaluation of: > ``C:\jakarta-jmeter-2.0.1\lib\createdata.bsh;'' Token Parsing Error: > Lexical error at line 1, column 3. Encountered: "\\" (92), after : > "": > <at unknown location> > > at bsh.Interpreter.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > at bsh.Interpreter.eval(Unknown Source) > ... 17 more > > I have tried to use various iterations of how I entered the script > filename in the function parameter list. Such as quoting the filename, > including the entire path, placing it in jar file in the lib directory > under JMeter and many others. What is the trick to passing the filename > to this function. The BeanShell script runs correctly in the BeanShell gui. > > Thanks > > Mike > > ________________________________________________________________ > The best thing to hit the Internet in years - Juno SpeedBand! > Surf the Web up to FIVE TIMES FASTER! > Only $14.95/ month - visit www.juno.com to sign up today! > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

