Re: Grinder bug report?
Philip Aston <[email protected]> Thu, 1 Dec 2016 18:35:20 +0000
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============3747838336114670411== Content-Type: multipart/alternative; boundary="------------E15371903B0453311B4A32CF" This is a multi-part message in MIME format. --------------E15371903B0453311B4A32CF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit My bad. The change to the plugin has not been released. Anyway, I've now read what you're trying to do and I'm afraid its not supported. The plugin needs to be initialised before a script can access them, and that process is built into the worker process. The same applies to parts of the script API, e.g. test instrumentation and statistics. The net result is a script can only access the script API run by the grinder worker process. - Phil On 01/12/16 15:11, Dorian Cransac wrote: > > Im sorry: that's with 3.11. > > > On Dec 1, 2016 15:57, "Philip Aston" <[email protected] > <mailto:[email protected]>> wrote: > > Can you try with 3.11? > > On 01/12/16 14:50, Dorian Cransac wrote: >> Hi Philip, >> >> Thanks for your reply. I'm copying the full stacktrace down below >> as well as the script itself and the code of the test class. It >> seems fairly easy to reproduce. (Btw I don't know why I mentioned >> Nashorn in my previous email, I'm obviously just running the >> jython engine, sorry about that)/ >> >> _Script "GrinderHTTP.py" :_ >> from net.grinder.script.Grinder import grinder >> from net.grinder.plugin.http import HTTPPlugin >> from net.grinder.plugin.http import HTTPRequest >> >> request1 = HTTPRequest() >> >> result = request1.GET("http://www.denkbar.io/ >> <http://www.denkbar.io/>") >> >> >> _Full stacktrace :_ >> javax.script.ScriptException: >> java.lang.ExceptionInInitializerError: >> java.lang.ExceptionInInitializerError in <script> at line number 2 >> at >> org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:202) >> at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:42) >> at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:47) >> at >> javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249) >> at TestGrinder.main(TestGrinder.java:32) >> Caused by: Traceback (most recent call last): >> File "<script>", line 2, in <module> >> java.lang.ExceptionInInitializerError >> >> at java.lang.Class.forName0(Native Method) >> >> at java.lang.Class.forName(Class.java:348) >> >> at org.python.core.Py >> <http://org.python.core.Py>.loadAndInitClass(Py.java:991) >> >> at org.python.core.Py >> <http://org.python.core.Py>.findClassInternal(Py.java:926) >> >> at org.python.core.Py.findClass(Py.java:951) >> >> at >> org.python.core.JavaImportHelper.isJavaClass(JavaImportHelper.java:182) >> >> at >> org.python.core.JavaImportHelper.tryAddPackage(JavaImportHelper.java:41) >> >> at org.python.core.imp.import_next(imp.java:845) >> >> at org.python.core.imp.import_logic(imp.java:904) >> >> at org.python.core.imp.import_module_level(imp.java:978) >> >> at org.python.core.imp.importName(imp.java:1062) >> >> at org.python.core.ImportFunction.__call__(__builtin__.java:1280) >> >> at org.python.core.PyObject.__call__(PyObject.java:431) >> >> at org.python.core.__builtin__.__import__(__builtin__.java:1232) >> >> at org.python.core.imp.importFromAs(imp.java:1156) >> >> at org.python.core.imp.importFrom(imp.java:1132) >> >> at org.python.pycode._pyx0.f$0(<script>:7) >> >> at org.python.pycode._pyx0.call_function(<script>) >> >> at org.python.core.PyTableCode.call(PyTableCode.java:167) >> >> at org.python.core.PyCode.call(PyCode.java:18) >> >> at org.python.core.Py.runCode(Py.java:1386) >> >> at org.python.core.__builtin__.eval(__builtin__.java:497) >> >> at org.python.core.__builtin__.eval(__builtin__.java:501) >> >> at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:259) >> >> at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:40) >> >> at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:47) >> >> at >> javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249) >> >> at TestGrinder.main(TestGrinder.java:32) >> >> Caused by: java.lang.NullPointerException >> >> at net.grinder.plugin.http.HTTPPlugin.<clinit>(HTTPPlugin.java:60) >> >> ... 28 more >> >> >> java.lang.ExceptionInInitializerError: >> java.lang.ExceptionInInitializerError >> >> at org.python.core.Py.JavaError(Py.java:546) >> at org.python.core.PyTableCode.call(PyTableCode.java:170) >> at org.python.core.PyCode.call(PyCode.java:18) >> at org.python.core.Py.runCode(Py.java:1386) >> at org.python.core.__builtin__.eval(__builtin__.java:497) >> at org.python.core.__builtin__.eval(__builtin__.java:501) >> at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:259) >> at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:40) >> ... 3 more >> Caused by: java.lang.ExceptionInInitializerError >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:348) >> at org.python.core.Py >> <http://org.python.core.Py>.loadAndInitClass(Py.java:991) >> at org.python.core.Py >> <http://org.python.core.Py>.findClassInternal(Py.java:926) >> at org.python.core.Py.findClass(Py.java:951) >> at >> org.python.core.JavaImportHelper.isJavaClass(JavaImportHelper.java:182) >> at >> org.python.core.JavaImportHelper.tryAddPackage(JavaImportHelper.java:41) >> at org.python.core.imp.import_next(imp.java:845) >> at org.python.core.imp.import_logic(imp.java:904) >> at org.python.core.imp.import_module_level(imp.java:978) >> at org.python.core.imp.importName(imp.java:1062) >> at org.python.core.ImportFunction.__call__(__builtin__.java:1280) >> at org.python.core.PyObject.__call__(PyObject.java:431) >> at org.python.core.__builtin__.__import__(__builtin__.java:1232) >> at org.python.core.imp.importFromAs(imp.java:1156) >> at org.python.core.imp.importFrom(imp.java:1132) >> at org.python.pycode._pyx0.f$0(<script>:7) >> at org.python.pycode._pyx0.call_function(<script>) >> at org.python.core.PyTableCode.call(PyTableCode.java:167) >> ... 9 more >> Caused by: java.lang.NullPointerException >> at net.grinder.plugin.http.HTTPPlugin.<clinit>(HTTPPlugin.java:60) >> ... 28 more >> >> _And the code of my test class :_ >> >> import java.io.BufferedReader; >> import java.io.File; >> import java.io.FileInputStream; >> import java.io.FileNotFoundException; >> import java.io.IOException; >> import java.io.InputStreamReader; >> import java.io.Reader; >> import java.nio.charset.Charset; >> >> import javax.script.ScriptEngine; >> import javax.script.ScriptEngineManager; >> import javax.script.ScriptException; >> >> public class TestGrinder { >> >> public static void main(String... args){ >> >> ScriptEngineManager manager = new ScriptEngineManager(); >> ScriptEngine engine = manager.getEngineByName("jython"); >> >> File scriptFile = new File("D:\\GrinderHTTP.py"); >> >> Reader reader = null; >> try { >> reader = new BufferedReader(new InputStreamReader(new >> FileInputStream(scriptFile), Charset.forName("UTF-8"))); >> } catch (FileNotFoundException e1) { >> // TODO Auto-generated catch block >> e1.printStackTrace(); >> } >> try { >> try { >> engine.eval(reader); >> } catch (ScriptException e) { >> // TODO Auto-generated catch block >> e.printStackTrace(); >> } >> } finally { >> if(reader!=null) { >> try { >> reader.close(); >> } catch (IOException e) { >> // TODO Auto-generated catch block >> e.printStackTrace(); >> } >> } >> } >> } >> } >> >> >> >> On Thu, Dec 1, 2016 at 3:30 PM, Philip Aston <[email protected] >> <mailto:[email protected]>> wrote: >> >> There are still a few stalwarts hanging out on grinder-use >> (cc'd), so start there. >> >> Looking at that archive message, its for an older version of >> the grinder. The code that's throwing an NPE in that message >> doesn't exist any more. >> >> I'm guessing you're using 3.11. You'll need to provide the >> error message if you want someone to diagnose it. >> >> - Phil >> >> >> On 01/12/16 13:58, Dorian Cransac wrote: >>> Hi Philip, >>> >>> I hope I'm not bothering you with this email. I've used the >>> grinder repeatedly over the course of my career and so I >>> guess starting this email with a thank you would be >>> appropriate. So thank you :) >>> >>> I'm currently trying to use the HTTP plugin and objects of >>> the grinder from within a jython script running on Nashorn >>> (via Java's ScriptEngine). >>> >>> I'm running into a problem which seems to have been reported >>> a couple of times in the past but never really addressed, >>> from what I understand (I found a few similar reports such >>> as this one : >>> https://sourceforge.net/p/grinder/mailman/message/29028470/ >>> <https://sourceforge.net/p/grinder/mailman/message/29028470/> ). >>> >>> It's a fairly strange bug as the class and corresponding jar >>> file are definitely present in my classpath but something in >>> the static initializer seems to be interfering with the >>> classpath mecanics. >>> >>> Seeing that there isn't much activity anymore on the >>> sourceforge project, I was wondering if I should still try >>> to open a ticket there or if you could maybe direct me >>> towards someone who would be willing to help debugging this >>> error. >>> >>> Best Regards, >>> -- >>> Dorian Cransac >>> http://denkbar.io >> >> >> >> >> >> -- >> Dorian Cransac >> http://denkbar.io > > --------------E15371903B0453311B4A32CF Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">My bad. The change to the plugin has not been released.<br> <br> <br> Anyway, I've now read what you're trying to do and I'm afraid its not supported.<br> <br> The plugin needs to be initialised before a script can access them, and that process is built into the worker process. The same applies to parts of the script API, e.g. test instrumentation and statistics. The net result is a script can only access the script API run by the grinder worker process.<br> <br> - Phil<br> <br> <br> <br> On 01/12/16 15:11, Dorian Cransac wrote:<br> </div> <blockquote cite="mid:CAE4v=GTNOgm4hWoZt2qZa58WcFunKGUdYOWB8xTqL4_Ja4ikpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org" type="cite"> <p dir="ltr">Im sorry: that's with 3.11.</p> <div class="gmail_extra"><br> <div class="gmail_quote">On Dec 1, 2016 15:57, "Philip Aston" <<a moz-do-not-send="true" href="mailto:[email protected]">[email protected]</a>> wrote:<br type="attribution"> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div bgcolor="#FFFFFF" text="#000000"> <div class="m_-8755322984812116062moz-cite-prefix">Can you try with 3.11?<br> <br> On 01/12/16 14:50, Dorian Cransac wrote:<br> </div> <blockquote type="cite"> <div dir="ltr">Hi Philip, <div><br> </div> <div>Thanks for your reply. I'm copying the full stacktrace down below as well as the script itself and the code of the test class. It seems fairly easy to reproduce. (Btw I don't know why I mentioned Nashorn in my previous email, I'm obviously just running the jython engine, sorry about that)/</div> <div><br> </div> <div><u>Script "GrinderHTTP.py" :</u></div> <div> <div>from net.grinder.script.Grinder import grinder</div> <div>from net.grinder.plugin.http import HTTPPlugin</div> <div>from net.grinder.plugin.http import HTTPRequest</div> <div><br> </div> <div>request1 = HTTPRequest()</div> <div><br> </div> <div>result = request1.GET("<a moz-do-not-send="true" href="http://www.denkbar.io/" target="_blank">http://www.<wbr>denkbar.io/</a>")</div> </div> <div><br> </div> <div><br> </div> <div><u>Full stacktrace :</u></div> <div> <div>javax.script.ScriptException: java.lang.<wbr>ExceptionInInitializerError: java.lang.<wbr>ExceptionInInitializerError in <script> at line number 2</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.jsr223.<wbr>PyScriptEngine.<wbr>scriptException(<wbr>PyScriptEngine.java:202)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.jsr223.<wbr>PyScriptEngine.eval(<wbr>PyScriptEngine.java:42)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.jsr223.<wbr>PyScriptEngine.eval(<wbr>PyScriptEngine.java:47)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at javax.script.<wbr>AbstractScriptEngine.eval(<wbr>AbstractScriptEngine.java:249)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at TestGrinder.main(TestGrinder.<wbr>java:32)</div> <div>Caused by: Traceback (most recent call last):</div> <div> File "<script>", line 2, in <module></div> <div>java.lang.<wbr>ExceptionInInitializerError</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.lang.Class.forName0(<wbr>Native Method)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.lang.Class.forName(Class.<wbr>java:348)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at <a moz-do-not-send="true" href="http://org.python.core.Py">org.python.core.Py</a>.<wbr>loadAndInitClass(Py.java:991)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at <a moz-do-not-send="true" href="http://org.python.core.Py">org.python.core.Py</a>.<wbr>findClassInternal(Py.java:926)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.Py.findClass(<wbr>Py.java:951)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.<wbr>JavaImportHelper.isJavaClass(<wbr>JavaImportHelper.java:182)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.<wbr>JavaImportHelper.<wbr>tryAddPackage(<wbr>JavaImportHelper.java:41)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.import_<wbr>next(imp.java:845)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.import_<wbr>logic(imp.java:904)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.import_<wbr>module_level(imp.java:978)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.<wbr>importName(imp.java:1062)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.<wbr>ImportFunction.__call__(__<wbr>builtin__.java:1280)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.PyObject.__<wbr>call__(PyObject.java:431)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.__builtin__.__<wbr>import__(__builtin__.java:<wbr>1232)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.<wbr>importFromAs(imp.java:1156)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.<wbr>importFrom(imp.java:1132)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.pycode._pyx0.f$0(<<wbr>script>:7)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.pycode._pyx0.call_<wbr>function(<script>)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.PyTableCode.<wbr>call(PyTableCode.java:167)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.PyCode.call(<wbr>PyCode.java:18)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.Py.runCode(Py.<wbr>java:1386)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.__builtin__.<wbr>eval(__builtin__.java:497)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.__builtin__.<wbr>eval(__builtin__.java:501)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.util.<wbr>PythonInterpreter.eval(<wbr>PythonInterpreter.java:259)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.jsr223.<wbr>PyScriptEngine.eval(<wbr>PyScriptEngine.java:40)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.jsr223.<wbr>PyScriptEngine.eval(<wbr>PyScriptEngine.java:47)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at javax.script.<wbr>AbstractScriptEngine.eval(<wbr>AbstractScriptEngine.java:249)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at TestGrinder.main(TestGrinder.<wbr>java:32)</div> <div><br> </div> <div>Caused by: java.lang.NullPointerException</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at net.grinder.plugin.http.<wbr>HTTPPlugin.<clinit>(<wbr>HTTPPlugin.java:60)</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>... 28 more</div> <div><br> </div> <div><br> </div> <div>java.lang.<wbr>ExceptionInInitializerError: java.lang.<wbr>ExceptionInInitializerError</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.Py.JavaError(<wbr>Py.java:546)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.PyTableCode.<wbr>call(PyTableCode.java:170)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.PyCode.call(<wbr>PyCode.java:18)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.Py.runCode(Py.<wbr>java:1386)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.__builtin__.<wbr>eval(__builtin__.java:497)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.__builtin__.<wbr>eval(__builtin__.java:501)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.util.<wbr>PythonInterpreter.eval(<wbr>PythonInterpreter.java:259)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.jsr223.<wbr>PyScriptEngine.eval(<wbr>PyScriptEngine.java:40)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>... 3 more</div> <div>Caused by: java.lang.<wbr>ExceptionInInitializerError</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.lang.Class.forName0(<wbr>Native Method)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at java.lang.Class.forName(Class.<wbr>java:348)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at <a moz-do-not-send="true" href="http://org.python.core.Py">org.python.core.Py</a>.<wbr>loadAndInitClass(Py.java:991)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at <a moz-do-not-send="true" href="http://org.python.core.Py">org.python.core.Py</a>.<wbr>findClassInternal(Py.java:926)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.Py.findClass(<wbr>Py.java:951)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.<wbr>JavaImportHelper.isJavaClass(<wbr>JavaImportHelper.java:182)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.<wbr>JavaImportHelper.<wbr>tryAddPackage(<wbr>JavaImportHelper.java:41)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.import_<wbr>next(imp.java:845)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.import_<wbr>logic(imp.java:904)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.import_<wbr>module_level(imp.java:978)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.<wbr>importName(imp.java:1062)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.<wbr>ImportFunction.__call__(__<wbr>builtin__.java:1280)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.PyObject.__<wbr>call__(PyObject.java:431)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.__builtin__.__<wbr>import__(__builtin__.java:<wbr>1232)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.<wbr>importFromAs(imp.java:1156)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.imp.<wbr>importFrom(imp.java:1132)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.pycode._pyx0.f$0(<<wbr>script>:7)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.pycode._pyx0.call_<wbr>function(<script>)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at org.python.core.PyTableCode.<wbr>call(PyTableCode.java:167)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>... 9 more</div> <div>Caused by: java.lang.NullPointerException</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>at net.grinder.plugin.http.<wbr>HTTPPlugin.<clinit>(<wbr>HTTPPlugin.java:60)</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>... 28 more</div> </div> <div><br> </div> <div><u>And the code of my test class :</u></div> <div><br> </div> <div> <div>import java.io.BufferedReader;</div> <div>import java.io.File;</div> <div>import java.io.FileInputStream;</div> <div>import java.io.FileNotFoundException;</div> <div>import java.io.IOException;</div> <div>import java.io.InputStreamReader;</div> <div>import java.io.Reader;</div> <div>import java.nio.charset.Charset;</div> <div><br> </div> <div>import javax.script.ScriptEngine;</div> <div>import javax.script.<wbr>ScriptEngineManager;</div> <div>import javax.script.ScriptException;</div> <div><br> </div> <div>public class TestGrinder {</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>public static void main(String... args){</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>ScriptEngineManager manager = new ScriptEngineManager();</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>ScriptEngine engine = manager.getEngineByName("<wbr>jython");</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>File scriptFile = new File("D:\\GrinderHTTP.py");</div> <div><br> </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>Reader reader = null;</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>try {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>reader = new BufferedReader(new InputStreamReader(new FileInputStream(scriptFile), Charset.forName("UTF-8")));</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} catch (FileNotFoundException e1) {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>// TODO Auto-generated catch block</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>e1.printStackTrace();</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} </div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>try {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>try {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>engine.eval(reader);</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} catch (ScriptException e) {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>// TODO Auto-generated catch block</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>e.printStackTrace();</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} finally {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>if(reader!=null) {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>try {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>reader.close();</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>} catch (IOException e) {</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>// TODO Auto-generated catch block</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>e.printStackTrace();</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</div> <div><span class="m_-8755322984812116062gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</div> <div>}</div> </div> <div><br> </div> <div><br> </div> </div> <div class="gmail_extra"><br> <div class="gmail_quote">On Thu, Dec 1, 2016 at 3:30 PM, Philip Aston <span dir="ltr"><<a moz-do-not-send="true" href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div bgcolor="#FFFFFF" text="#000000"> <div class="m_-8755322984812116062m_6494728983689282515moz-cite-prefix">There are still a few stalwarts hanging out on grinder-use (cc'd), so start there.<br> <br> Looking at that archive message, its for an older version of the grinder. The code that's throwing an NPE in that message doesn't exist any more.<br> <br> I'm guessing you're using 3.11. You'll need to provide the error message if you want someone to diagnose it.<br> <br> - Phil <div> <div class="m_-8755322984812116062h5"><br> <br> On 01/12/16 13:58, Dorian Cransac wrote:<br> </div> </div> </div> <div> <div class="m_-8755322984812116062h5"> <blockquote type="cite"> <div dir="ltr"> <div>Hi Philip,</div> <div><br> </div> <div>I hope I'm not bothering you with this email. I've used the grinder repeatedly over the course of my career and so I guess starting this email with a thank you would be appropriate. So thank you :)</div> <div><br> </div> <div>I'm currently trying to use the HTTP plugin and objects of the grinder from within a jython script running on Nashorn (via Java's ScriptEngine).</div> <div><br> </div> <div>I'm running into a problem which seems to have been reported a couple of times in the past but never really addressed, from what I understand (I found a few similar reports such as this one : <a moz-do-not-send="true" href="https://sourceforge.net/p/grinder/mailman/message/29028470/" target="_blank">https://sourceforge.net/p/grin<wbr>der/mailman/message/29028470/</a> ).</div> <div><br> </div> <div>It's a fairly strange bug as the class and corresponding jar file are definitely present in my classpath but something in the static initializer seems to be interfering with the classpath mecanics.</div> <div><br> </div> <div>Seeing that there isn't much activity anymore on the sourceforge project, I was wondering if I should still try to open a ticket there or if you could maybe direct me towards someone who would be willing to help debugging this error.</div> <div><br> </div> <div>Best Regards,</div> -- <br> <div class="m_-8755322984812116062m_6494728983689282515gmail_signature"> <div dir="ltr">Dorian Cransac <div><a moz-do-not-send="true" href="http://denkbar.io" target="_blank">http://denkbar.io</a></div> </div> </div> </div> </blockquote> <p><br> </p> </div> </div> </div> </blockquote> </div> <br> <br clear="all"> <div><br> </div> -- <br> <div class="m_-8755322984812116062gmail_signature" data-smartmail="gmail_signature"> <div dir="ltr">Dorian Cransac <div><a moz-do-not-send="true" href="http://denkbar.io" target="_blank">http://denkbar.io</a></div> </div> </div> </div> </blockquote> <p><br> </p> </div> </blockquote> </div> </div> </blockquote> <p><br> </p> </body> </html> --------------E15371903B0453311B4A32CF-- --===============3747838336114670411== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ --===============3747838336114670411== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ grinder-use mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/grinder-use --===============3747838336114670411==--