Re: [Grinder-use] Aborted run due to Jython exception: TypeError: POST(): 2nd arg can't be coerced
Distributed load testing framework - Java, Jython, or Clojure scripts.
Brought to you by:
philipa
From: Philip A. <pa...@be...> - 2008-03-26 22:33:16
|
This is the same as the bug recently reported to this list by Dhinakar, and appears to be due to the difference in the bundled versions of Jython. % /opt/jython/jython-2.1/jython Jython 2.1 on java1.6.0_03 (JIT: null) >>> from java.lang import String as S >>> S(( 0xAC,)) � % /opt/jython/jython2.2.1/jython Jython 2.2.1 on java1.5.0_12 Type "copyright", "credits" or "license" for more information. >>> from java.lang import String as S >>> S(( 0xAC,)) Traceback (innermost last): File "<console>", line 1, in ? TypeError: java.lang.String(): 1st arg can't be coerced to java.lang.StringBuilder, char[], byte[], String or java.lang.StringBuffer >>> Oh crap. Further... % /opt/jython/jython-2.1/jython Jython 2.1 on java1.6.0_03 (JIT: null) >>> from jarray import * >>> array((0x80,), 'b') array([-128], byte) % /opt/jython/jython2.2.1/jython Jython 2.2.1 on java1.5.0_12 Type "copyright", "credits" or "license" for more information. >>> from jarray import * >>> array((0x80,), 'b') OverflowError: value too large for byte I've opened bug 1926601. The best immediate workaround I can suggest is to put the jython.jar from beta33 in the CLASSPATH before the grinder.jar from 3.0.1. - Phil O.A.Francis wrote: > Hi > I am getting the error when I run a test script in > Grinder 3.0.1. The same script running smoothly in > grinder-3.0-beta33. > > Error: > Aborted run due to Jython exception: TypeError: > POST(): 2nd arg can't be coerced to byte[] or > HTTPClient.NVPair[] [calling TestRunner] > TypeError: POST(): 2nd arg can't be coerced to byte[] > or HTTPClient.NVPair[] > > The script snippets: > > onnectionDefaults.defaultHeaders = \ > ( NVPair('User-Agent', 'Java/1.5.0_14'), > NVPair('Cache-Control', 'no-cache'), ) > headers0= \ > ( NVPair('Accept', 'text/html, image/gif, > image/jpeg, *; q=.2, */*; q=.2'), ) > headers1= \ > ( NVPair('Accept', 'text/xml'), ) > > url0 = 'http://3dmmdx64:80' > > - - - -- -- - -- - - - - -- -- - -- -- - - - -- -- - > - -- - - - > - - - -- -- - -- - - - - -- -- - -- -- - - - -- -- - > - -- - - - > > def page5(self): > """POST xmldom (request 501).""" > result = request501.POST('/xmldom', > ( 0xAC, 0xED, 0x00, 0x05, 0x73, 0x72, 0x00, > 0x21, > 0x63, 0x6F, 0x6D, 0x2E, 0x6D, 0x65, 0x72, > 0x63, > 0x75, 0x72, 0x79, 0x2E, 0x78, 0x6D, 0x6C, > 0x2E, > - - - - - - - - - - - - - - - - - -- - - -- > - - - - - - - - - > - - - - - - -- - - - -- - -- - - - - - - - - - > - - - -- - - -- > 0x5D, 0x74, 0x00, 0x06, 0x3C, 0x4E, 0x4F, 0x4E, > > 0x45, 0x3E, 0x70, 0x70, 0x71, 0x00, 0x7E, > 0x00, > 0x3B, 0x78, 0x70, 0x70, 0x78, ), > ( NVPair('Content-Type', > 'x-application/compiled-xml-command'), )) > return result > > > Thanks in advance for the help > > Francis > > Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. |