Re: NPE in WOHTTPConnection readResponse()
Re: NPE in WOHTTPConnection readResponse()
- Subject: Re: NPE in WOHTTPConnection readResponse()
- From: Alexander Spohr <email@hidden>
- Date: Tue, 22 Jan 2008 18:27:06 +0100
Similar problem here. That code runs on two machines but not on a
third. We have WO in the apps bundle.
Runs on machine one using Java 1.5/MacOSX, machine two 1.6/Linux, not
on machine three with 1.5/Linux.
2008-01-22 17:50:20,244 WARN [WorkerThread0] NSLog: <WOWorkerThread
id=0 socket=Socket[addr127.0.0.1,port=53181,localport=2201]> Exception
occurred while responding to client: java.lang.NullPointerException
[2008-1-22 16:50:20 CET] <WorkerThread0> java.lang.NullPointerException
at com.webobjects.foundation.NSArray.toArray(NSArray.java:976)
at java.util.ArrayList.<init>(ArrayList.java:136)
at com.webobjects.appserver.WOMessage.setHeaders(WOMessage.java:363)
at com.webobjects.appserver.WOMessage._finalizeCookies(WOMessage.java:
566)
at
com.webobjects.appserver.WOResponse._finalizeInContext(WOResponse.java:
212)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._handleRequest(WOComponentRequestHandler.java:411)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
.handleRequest(WOComponentRequestHandler.java:442)
at
com
.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:
167
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at
com
.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:
226)
at java.lang.Thread.run(Thread.java:595)
Am 22.01.2008 um 05:24 schrieb Thomas:
I'm trying to get WOPayPal working in WO 5.4, and I've narrowed down
to a problem in readResponse(). Below is some sample code I am using
to fetch a page from my own web server, and it fails on that as well.
I anybody using WOHTTPConnection.readResponse() ? What am I doing
wrong?
I'm running on 10.5.1 client (same happens on server) with WO 5.4
and a 5.4-specific version of WOnder from late December. It does the
same with last night's build of the 5.4 WOnder.
Regards
Thomas
// both connectHost and connectPath are set to valid values.
WOHTTPConnection ppEchoConnection = new
WOHTTPConnection(connectHost, 80);
NSMutableDictionary headers = new NSMutableDictionary();
headers.setObjectForKey("en", "Accept-Language");
headers.setObjectForKey("iso-8859-1,*,utf-8", "Accept-Charset");
headers.setObjectForKey("image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, image/png, */*", "Accept");
headers.setObjectForKey("WebObjects/5.4 [en] (i386; Mac OS X
10.5.1)","User-Agent");
WORequest request = new WORequest("GET", connectPath, "HTTP/1.1",
headers, null, null);
request.setContent(connectPath);
ppEchoConnection.setReceiveTimeout(90 * 1000);
boolean success = ppEchoConnection.sendRequest(request);
// everything is working fine to this point. The web server log
shows the correct URL is requested and content returned.
if (success) {
stringA = ppEchoConnection.readResponse().contentString(); // NPE
below happens here
}
java.lang.NullPointerException
at com.webobjects.foundation.NSArray.toArray(NSArray.java:965)
at java.util.ArrayList.<init>(ArrayList.java:136)
at com.webobjects.appserver.WOMessage.appendHeaders(WOMessage.java:
645)
at
com
.webobjects
.appserver.WOHTTPConnection.setResponseHeaders(WOHTTPConnection.java:
124)
at
com
.webobjects
.appserver.WOHTTPConnection.readResponse(WOHTTPConnection.java:581)
at biz.webjini.Test.fetchURL(Test.java:106)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Freeport & Soliversum
Alexander Spohr
email@hidden
www.freeport.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden