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

List:       grinder-use
Subject:    Re: [Grinder-use] Nullpointerexception calling Test() or
From:       Philip Aston <philipa () mail ! com>
Date:       2008-03-31 12:11:20
Message-ID: 47F0D4E8.4020200 () mail ! com
[Download RAW message or body]

The Grinder sets up a bunch of context that the instrumentation (Test)
and plug-ins rely on. There's currently no support for running scripts
under the Jython interpreter alone.

- Phil

Bernie Wong wrote:
>
>  
>
> Hi, I am getting a nullpointer exception when I try to incrementally
> run my Grinder script in the Jython command line. I was wondering if
> you can help.
>
>  
>
> C:\jython2.2.1>jython
>
>  
>
> Jython 2.2.1 on java1.5.0_13
>
> Type "copyright", "credits" or "license" for more information.
>
> >>> from net.grinder.script import Test
>
> >>> from net.grinder.script.Grinder import grinder
>
> >>> from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
>
> >>> from HTTPClient import NVPair
>
> >>> from java.lang import System
>
> >>> connectionDefaults = HTTPPluginControl.getConnectionDefaults()
>
> >>> httpUtilities = HTTPPluginControl.getHTTPUtilities()
>
> >>> connectionDefaults.defaultHeaders = \
>
> ...   ( NVPair('User-Agent', 'Mozilla/4.0 (compatible; MSIE 6.0;
> Windows NT 5.1)
>
>  (compatible; MSIE 7.0; Windows NT 5.1; SU 3.011; .NET CLR 1.1.4322;
> .NET CLR 2.
>
> 0.50727; .NET CLR 3.0.04506.30; InfoPath.1; .NET CLR 3.0.04506.648)'),
>
> ...     NVPair('Accept-Language', 'en-us'), )
>
> >>> 
>
>  
>
> >>> headers0= \
>
> ...   ( NVPair('Accept', 'image/gif, image/x-xbitmap, image/jpeg,
> image/pjpeg, application/x-shockwave-flash, application/xaml+xml,
> application/vnd.ms-xpsdocument, application/x-ms-xbap,
> application/x-ms-application, application/vnd.ms-excel,
> application/vnd.ms-powerpoint, application/msword, */*'), )
>
>  
>
> >>> url0 = 'http://10.10.10.10:9012'
>
>  
>
> >>> request101 = HTTPRequest(url=url0, headers=headers0)
>
>  
>
> >>> result = request101.GET('/acme/en/US/adirect/matrix')
>
> Traceback (innermost last):
>
>   File "<console>", line 1, in ?
>
>         at
> net.grinder.plugin.http.HTTPRequest$AbstractRequest.getHTTPResponse(H
>
> TTPRequest.java:868)
>
>         at net.grinder.plugin.http.HTTPRequest.GET(HTTPRequest.java:386)
>
>         at net.grinder.plugin.http.HTTPRequest.GET(HTTPRequest.java:332)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>
> java:39)
>
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>
> sorImpl.java:25)
>
>         at java.lang.reflect.Method.invoke(Method.java:585)
>
>  
>
> java.lang.NullPointerException: java.lang.NullPointerException
>
> >>> 
>
>  
>
> Also, I get a NPE when I issue
>
>  
>
> >>> request101 = HTTPRequest(url=url0, headers=headers0)
>
> >>> request101 = Test(101, 'GET matrix').wrap(request101)
>
> Traceback (innermost last):
>
>   File "<console>", line 1, in ?
>
>         at net.grinder.script.Test.<init>(Test.java:66)
>
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>
>  
>
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
>
> orAccessorImpl.java:39)
>
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
>
> onstructorAccessorImpl.java:27)
>
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>
>  
>
> java.lang.NullPointerException: java.lang.NullPointerException
>
> >>> request101 = Test(101, 'GET matrix').wrap(request101)
>
> Traceback (innermost last):
>
>   File "<console>", line 1, in ?
>
>         at net.grinder.script.Test.<init>(Test.java:66)
>
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>
>  
>
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
>
> orAccessorImpl.java:39)
>
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
>
> onstructorAccessorImpl.java:27)
>
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>
>  
>
> java.lang.NullPointerException: java.lang.NullPointerException
>
> >>> 
>
>  
>
> Thanks in advance.
>
>  
>
> Bernie
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
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