[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grinder-use
Subject:    Re: [Grinder-use] Help needed: how to debug grinder test script
From:       Gary Mulder <flyingkiwiguy () gmail ! com>
Date:       2012-08-28 9:05:08
Message-ID: CAKy9zTD=0D57yAjDRunU1KoF1BSf+mTOezypscFEX50Lpg4HOg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Lee,

You need to run your script within the Grinder script execution
environment, not directly using Jython. There are a lot of supporting
Grinder classes that your script depends on. Have a look at the User Guide
here:

http://grinder.sourceforge.net/g3/getting-started.html

Specifically you need to create the start scripts "setGrinderEnv.cmd"
and "startAgent.cmd"
(assuming you're using Windows).

Also look at the docs for the grinder.properties file here, which is where
you tell The Grinder where your test script resides:

http://grinder.sourceforge.net/g3/properties.html

Regards,
Gary

On 27 August 2012 15:46, Li Lin <guru.lin@gmail.com> wrote:

> Hi all,
>
> I'm a newbie just started to use Grinder. I googled quite a bit but
> didn't turn up anything that I need. My apologies if the question had
> been asked on the list already.
>
> I'm looking for a way to use simple jython debugger to debug test
> script generated by TCPProxy.
>
> when I try to run a simple script via jython:
>
> jython grinder.py
>
> I got the following exception:
>
>   File "test1.py", line 12, in <module>
>     from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
> java.lang.ExceptionInInitializerError
>         at
> net.grinder.plugin.http.HTTPRequest.<clinit>(HTTPRequest.java:103)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:247)
>         at org.python.core.Py.loadAndInitClass(Py.java:909)
>         at org.python.core.Py.findClassInternal(Py.java:844)
>         at org.python.core.Py.findClassEx(Py.java:895)
>         at
> org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)
>         at
> org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28)
>         at
> org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)
>         at
> org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137)
>         at org.python.core.PyObject.__findattr__(PyObject.java:863)
>         at org.python.core.imp.importFromAs(imp.java:1015)
>         at org.python.core.imp.importFrom(imp.java:987)
>         at org.python.pycode._pyx0.f$0(test1.py:4266)
>         at org.python.pycode._pyx0.call_function(test1.py)
>         at org.python.core.PyTableCode.call(PyTableCode.java:165)
>         at org.python.core.PyCode.call(PyCode.java:18)
>         at org.python.core.Py.runCode(Py.java:1275)
>         at
> org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:235)
>         at org.python.util.jython.run(jython.java:247)
>         at org.python.util.jython.main(jython.java:129)
> Caused by: java.lang.NullPointerException
>         at net.grinder.plugin.http.HTTPPlugin.<clinit>(HTTPPlugin.java:60)
>         ... 21 more
>
> I'm guessing certain components must be initialized properly before I
> can run the script, but I'm not sure how to do that. Could anyone
> provide an example or any pointer?
>
> I'm aware of GrdinerStone, but it's currently broken for Grinder 3.6
> or above and there are times command line is all I can get and not
> Eclipse.
>
> thanks very much in advance.
>
> --
> --lee
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> grinder-use mailing list
> grinder-use@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/grinder-use
>

[Attachment #5 (text/html)]

<font face="tahoma, sans-serif">Hi Lee,</font><div><font face="tahoma, \
sans-serif"><br></font></div><div><font face="tahoma, sans-serif">You need to run \
your script within the Grinder script execution environment, not directly using \
Jython. There are a lot of supporting Grinder classes that your script depends on. \
Have a look at the User Guide here:</font></div> <div><font face="tahoma, \
sans-serif"><br></font></div><div><font face="tahoma, sans-serif"><a \
href="http://grinder.sourceforge.net/g3/getting-started.html">http://grinder.sourceforge.net/g3/getting-started.html</a> \
</font></div> <div><font face="tahoma, sans-serif"><br></font></div><div><font \
face="tahoma, sans-serif">Specifically you need to create the start scripts \
&quot;<span style="background-color:rgb(255,255,255);line-height:22px">setGrinderEnv.cmd&quot; \
and &quot;</span><span \
style="background-color:rgb(255,255,255);line-height:22px">startAgent.cmd&quot; \
(assuming you&#39;re using Windows).</span></font></div> <div><font face="tahoma, \
sans-serif"><br></font></div><div><font face="tahoma, sans-serif">Also look at the \
docs for the grinder.properties file here, which is where you tell The Grinder where \
your test script resides:</font></div> <div><font face="tahoma, \
sans-serif"><br></font></div><div><font face="tahoma, sans-serif"><a \
href="http://grinder.sourceforge.net/g3/properties.html">http://grinder.sourceforge.net/g3/properties.html</a> \
</font></div><div> <br></div><div>Regards,</div><div>Gary<br><br><div \
class="gmail_quote">On 27 August 2012 15:46, Li Lin <span dir="ltr">&lt;<a \
href="mailto:guru.lin@gmail.com" target="_blank">guru.lin@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> Hi all,<br>
<br>
I&#39;m a newbie just started to use Grinder. I googled quite a bit but<br>
didn&#39;t turn up anything that I need. My apologies if the question had<br>
been asked on the list already.<br>
<br>
I&#39;m looking for a way to use simple jython debugger to debug test<br>
script generated by TCPProxy.<br>
<br>
when I try to run a simple script via jython:<br>
<br>
jython grinder.py<br>
<br>
I got the following exception:<br>
<br>
   File &quot;test1.py&quot;, line 12, in &lt;module&gt;<br>
      from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest<br>
java.lang.ExceptionInInitializerError<br>
            at net.grinder.plugin.http.HTTPRequest.&lt;clinit&gt;(HTTPRequest.java:103)<br>
  at java.lang.Class.forName0(Native Method)<br>
            at java.lang.Class.forName(Class.java:247)<br>
            at org.python.core.Py.loadAndInitClass(Py.java:909)<br>
            at org.python.core.Py.findClassInternal(Py.java:844)<br>
            at org.python.core.Py.findClassEx(Py.java:895)<br>
            at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)<br>
                
            at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28)<br>
                
            at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)<br>
                
            at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137)<br>
                
            at org.python.core.PyObject.__findattr__(PyObject.java:863)<br>
            at org.python.core.imp.importFromAs(imp.java:1015)<br>
            at org.python.core.imp.importFrom(imp.java:987)<br>
            at org.python.pycode._pyx0.f$0(test1.py:4266)<br>
            at org.python.pycode._pyx0.call_function(test1.py)<br>
            at org.python.core.PyTableCode.call(PyTableCode.java:165)<br>
            at org.python.core.PyCode.call(PyCode.java:18)<br>
            at org.python.core.Py.runCode(Py.java:1275)<br>
            at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:235)<br>
  at org.python.util.jython.run(jython.java:247)<br>
            at org.python.util.jython.main(jython.java:129)<br>
Caused by: java.lang.NullPointerException<br>
            at net.grinder.plugin.http.HTTPPlugin.&lt;clinit&gt;(HTTPPlugin.java:60)<br>
                
            ... 21 more<br>
<br>
I&#39;m guessing certain components must be initialized properly before I<br>
can run the script, but I&#39;m not sure how to do that. Could anyone<br>
provide an example or any pointer?<br>
<br>
I&#39;m aware of GrdinerStone, but it&#39;s currently broken for Grinder 3.6<br>
or above and there are times command line is all I can get and not<br>
Eclipse.<br>
<br>
thanks very much in advance.<br>
<br>
--<br>
--lee<br>
<br>
------------------------------------------------------------------------------<br>
Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today&#39;s security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" \
target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br> \
_______________________________________________<br> grinder-use mailing list<br>
<a href="mailto:grinder-use@lists.sourceforge.net">grinder-use@lists.sourceforge.net</a><br>
 <a href="https://lists.sourceforge.net/lists/listinfo/grinder-use" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/grinder-use</a><br> \
</blockquote></div><br></div>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
grinder-use mailing list
grinder-use@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/grinder-use


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic