Phil,
I think the url you wanted to point out is the one given below:-
https://sourceforge.net/tracker/index.php?func=detail&aid=1926601&group_id=18598&atid=118598
I had downloaded the 'patch1926601.jar' from the above site and added
the location to my CLASSPATH before grinder.jar path. I then
re-recorded the script and was able to successfully execute it without
getting any 'TypeError: POST(): 2nd arg can't be coerced to byte[] or
HTTPClient.NVPair[] [calling TestRunner]' exceptions.
Thanks for the patch.
Regards,
Dhinakar
Note: Sorry earlier by mistake I had sent my post to your id instead
of group id.
On 4/1/08, Philip Aston <ph...@ma...> wrote:
> I think I've fixed this. I've attached a patch to the bug
> (https://sourceforge.net/tracker/index.php?func=detail&aid=1912346&group_id=18598&atid=118598).
>
> I'd be grateful if one of you could try it out and tell me whether it
> works for you. Unfortunately, the patch fixes the TCPProxy filter to
> generate Jython 2.2.1 compatible scripts, so you'll have to re-record
> your scripts.
>
> - Phil
>
> Philip Aston wrote:
> > 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
> >>
> >>
> >>
> >
> >
> >
>
>
|