Re: [axis2]REST requests failing
See comments inline On 3/14/07, Punnoose, Roshan <[EMAIL PROTECTED]> wrote: I have a REST GET request, and I keep getting this error: java.lang.NullPointerException. java.lang.NullPointerException at java.io.Reader.(Reader.java:61) at java.io.InputStreamReader.(InputStreamReader.java:80) at org.apache.axis2.builder.XFormURLEncodedBuilder.extractParametersFromReq uest(XFormURLEncodedBuilder.java:123) The stack trace above shows that your not using the latest code. The code in the current svn has a null check for inputStream. Yes the inputStream can be null in some cases, especially if the request is a GET. The XFormURLEncodedBuilder can be called for POST request as well, thats the reason for having the inputStream in there. Just try the latest code, if the problem persists send me the service so that i can debug and fix the problem. at org.apache.axis2.builder.XFormURLEncodedBuilder.processDocument(XFormURL EncodedBuilder.java:77) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti ls.java:120) at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil .java:98) at org.apache.axis2.transport.http.AxisServlet$ProcessRESTRequest.processUR LRequest(AxisServlet.java:767) at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:236) Any ideas? Roshan Punnoose Phone: 301-497-6039 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thanks, Keith. -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/
RE: [axis2]REST requests failing
I don't think so. I'm looking at the code right now, and it looks like the InputStream being null problem still exists. Not sure how to fix it though. Anyone have any ideas? Roshan Punnoose Phone: 301-497-6039 From: keith chapman [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 3:00 PM To: axis-user@ws.apache.org Subject: Re: [axis2]REST requests failing Hi Roshan, Can you provide me more details please so that I can try and reproduce the problem. I get the feeling that your not using the latest code though (I think this is fixed in the latest code). I will be glad to check it out if you can provide me some details. It works for me with the latest code... Thanks, Keith. On 3/14/07, Punnoose, Roshan <[EMAIL PROTECTED]> wrote: I'm not exactly sure the right way to proceed with this one. So I looked at the Axis2 1.0 code and was able to work with it to make this work for the time being. This is what I did: 1) Created my own servlet that extended AxisServlet (MyAxisServlet) which overrode the doGet(...) method. 2) Pretty much copied the code from the AxisServlet, except if it is a REST request, I did this: messageContext = createMessageContext(request, response, false); processGetRequest(messageContext, request, response); 3) processGetRequest(...) : Got this mostly from the 1.0 code. The only issue was that for the dispatchAndVerify(...) I had to have both the RequestURIDispatcher() to get the AxisService and the RequestURIOperationDispatcher() to get the AxisOperation being used. I have a feeling that a lot of these change might break what else is implemented, so if anyone has a real solution to the reason why the RESTUtil is sending a null inputStream into the processURLRequest, I'm very willing to listen. Roshan Punnoose Phone: 301-497-6039 -Original Message- From: Punnoose, Roshan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 11:30 AM To: axis-user@ws.apache.org Subject: RE: [axis2]REST requests failing Looks like the RESTUtil is sending the inputStream as null in the processURLRequest, which will break the TransportUtils class either way. What can we do? Roshan Punnoose Phone: 301-497-6039 -Original Message- From: Punnoose, Roshan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 11:24 AM To: axis-user@ws.apache.org Subject: [axis2]REST requests failing I have a REST GET request, and I keep getting this error: java.lang.NullPointerException. java.lang.NullPointerException at java.io.Reader.(Reader.java:61) at java.io.InputStreamReader.(InputStreamReader.java:80) at org.apache.axis2.builder.XFormURLEncodedBuilder.extractParametersFromReq uest(XFormURLEncodedBuilder.java:123) at org.apache.axis2.builder.XFormURLEncodedBuilder.processDocument(XFormURL EncodedBuilder.java:77) at org.apache.axis2.transport.TransportUtils.createSOAPMessage (TransportUti ls.java:120) at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil .java:98) at org.apache.axis2.transport.http.AxisServlet$ProcessRESTRequest.processUR LRequest(AxisServlet.java:767) at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:236) Any ideas? Roshan Punnoose Phone: 301-497-6039 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/ BEGIN:VCARD VERSION:2.1 N:Punnoose;Roshan FN:Punnoose, Roshan ADR;WORK:;2115 LABEL;WORK:2115 EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20050413T183207Z END:VCARD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [axis2]REST requests failing
Hi Roshan, Can you provide me more details please so that I can try and reproduce the problem. I get the feeling that your not using the latest code though (I think this is fixed in the latest code). I will be glad to check it out if you can provide me some details. It works for me with the latest code... Thanks, Keith. On 3/14/07, Punnoose, Roshan <[EMAIL PROTECTED]> wrote: I'm not exactly sure the right way to proceed with this one. So I looked at the Axis2 1.0 code and was able to work with it to make this work for the time being. This is what I did: 1) Created my own servlet that extended AxisServlet (MyAxisServlet) which overrode the doGet(...) method. 2) Pretty much copied the code from the AxisServlet, except if it is a REST request, I did this: messageContext = createMessageContext(request, response, false); processGetRequest(messageContext, request, response); 3) processGetRequest(...) : Got this mostly from the 1.0 code. The only issue was that for the dispatchAndVerify(...) I had to have both the RequestURIDispatcher() to get the AxisService and the RequestURIOperationDispatcher() to get the AxisOperation being used. I have a feeling that a lot of these change might break what else is implemented, so if anyone has a real solution to the reason why the RESTUtil is sending a null inputStream into the processURLRequest, I'm very willing to listen. Roshan Punnoose Phone: 301-497-6039 -Original Message- From: Punnoose, Roshan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 11:30 AM To: axis-user@ws.apache.org Subject: RE: [axis2]REST requests failing Looks like the RESTUtil is sending the inputStream as null in the processURLRequest, which will break the TransportUtils class either way. What can we do? Roshan Punnoose Phone: 301-497-6039 -Original Message- From: Punnoose, Roshan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 11:24 AM To: axis-user@ws.apache.org Subject: [axis2]REST requests failing I have a REST GET request, and I keep getting this error: java.lang.NullPointerException. java.lang.NullPointerException at java.io.Reader.(Reader.java:61) at java.io.InputStreamReader.(InputStreamReader.java:80) at org.apache.axis2.builder.XFormURLEncodedBuilder.extractParametersFromReq uest(XFormURLEncodedBuilder.java:123) at org.apache.axis2.builder.XFormURLEncodedBuilder.processDocument(XFormURL EncodedBuilder.java:77) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti ls.java:120) at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil .java:98) at org.apache.axis2.transport.http.AxisServlet$ProcessRESTRequest.processUR LRequest(AxisServlet.java:767) at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:236) Any ideas? Roshan Punnoose Phone: 301-497-6039 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/
RE: [axis2]REST requests failing
I'm not exactly sure the right way to proceed with this one. So I looked at the Axis2 1.0 code and was able to work with it to make this work for the time being. This is what I did: 1) Created my own servlet that extended AxisServlet (MyAxisServlet) which overrode the doGet(...) method. 2) Pretty much copied the code from the AxisServlet, except if it is a REST request, I did this: messageContext = createMessageContext(request, response, false); processGetRequest(messageContext, request, response); 3) processGetRequest(...) : Got this mostly from the 1.0 code. The only issue was that for the dispatchAndVerify(...) I had to have both the RequestURIDispatcher() to get the AxisService and the RequestURIOperationDispatcher() to get the AxisOperation being used. I have a feeling that a lot of these change might break what else is implemented, so if anyone has a real solution to the reason why the RESTUtil is sending a null inputStream into the processURLRequest, I'm very willing to listen. Roshan Punnoose Phone: 301-497-6039 -Original Message- From: Punnoose, Roshan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 11:30 AM To: axis-user@ws.apache.org Subject: RE: [axis2]REST requests failing Looks like the RESTUtil is sending the inputStream as null in the processURLRequest, which will break the TransportUtils class either way. What can we do? Roshan Punnoose Phone: 301-497-6039 -Original Message- From: Punnoose, Roshan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 11:24 AM To: axis-user@ws.apache.org Subject: [axis2]REST requests failing I have a REST GET request, and I keep getting this error: java.lang.NullPointerException. java.lang.NullPointerException at java.io.Reader.(Reader.java:61) at java.io.InputStreamReader.(InputStreamReader.java:80) at org.apache.axis2.builder.XFormURLEncodedBuilder.extractParametersFromReq uest(XFormURLEncodedBuilder.java:123) at org.apache.axis2.builder.XFormURLEncodedBuilder.processDocument(XFormURL EncodedBuilder.java:77) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti ls.java:120) at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil .java:98) at org.apache.axis2.transport.http.AxisServlet$ProcessRESTRequest.processUR LRequest(AxisServlet.java:767) at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:236) Any ideas? Roshan Punnoose Phone: 301-497-6039 BEGIN:VCARD VERSION:2.1 N:Punnoose;Roshan FN:Punnoose, Roshan ADR;WORK:;2115 LABEL;WORK:2115 EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20050413T183207Z END:VCARD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [axis2]REST requests failing
Looks like the RESTUtil is sending the inputStream as null in the processURLRequest, which will break the TransportUtils class either way. What can we do? Roshan Punnoose Phone: 301-497-6039 -Original Message- From: Punnoose, Roshan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 11:24 AM To: axis-user@ws.apache.org Subject: [axis2]REST requests failing I have a REST GET request, and I keep getting this error: java.lang.NullPointerException. java.lang.NullPointerException at java.io.Reader.(Reader.java:61) at java.io.InputStreamReader.(InputStreamReader.java:80) at org.apache.axis2.builder.XFormURLEncodedBuilder.extractParametersFromReq uest(XFormURLEncodedBuilder.java:123) at org.apache.axis2.builder.XFormURLEncodedBuilder.processDocument(XFormURL EncodedBuilder.java:77) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUti ls.java:120) at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil .java:98) at org.apache.axis2.transport.http.AxisServlet$ProcessRESTRequest.processUR LRequest(AxisServlet.java:767) at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:236) Any ideas? Roshan Punnoose Phone: 301-497-6039 BEGIN:VCARD VERSION:2.1 N:Punnoose;Roshan FN:Punnoose, Roshan ADR;WORK:;2115 LABEL;WORK:2115 EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20050413T183207Z END:VCARD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]