[
https://issues.apache.org/jira/browse/AXIS2-3007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515204
]
Keith Godwin Chapman commented on AXIS2-3007:
---------------------------------------------
Axis2 uses a pluggable builder concept here. There is a mapping in your
axis2.xml which specifies the builder to use for a specific contentType. When
you do a GET (obviously it does not have a method body hence the inputStream is
null here) the content type would be application/x-www-form-urlencoded most
often than not (Firefox sends null hence we do a check and set the appropriate
content type). There is a mapping which says application/x-www-form-urlencoded
will be processed by org.apache.axis2.builder.XFormURLEncodedBuilder. In your
case whats happened is that it has tried to process it using
ApplicationXMLBuilder (which is the one to be used when the content type is
application/xml which had a body).
Can you check your axis2.xml on this. You should be able to solve it there
without using the workaround u've specified. I wonderwhether there was another
problem somewhere else. Could u please verify this. If the problem persists
please provide the steps to recreate the issue to gether with the builder
mappings in your axis2.xml.
> RESTful services invocation self induces Input Stream Closed error
> ------------------------------------------------------------------
>
> Key: AXIS2-3007
> URL: https://issues.apache.org/jira/browse/AXIS2-3007
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: Windows 2000, Eclipse IDE
> Reporter: Jason Kania
> Assignee: Keith Godwin Chapman
>
> When making REST GET calls to an API, Axis 2 core sets its input stream to
> null and then complains later that its stream has been closed. The following
> partial stack trace demonstrates the problem.
> ApplicationXMLBuilder.processDocument(InputStream, String, MessageContext)
> line: 49
> TransportUtils.createSOAPMessage(MessageContext, InputStream, String) line:
> 130
> RESTUtil.processURLRequest(MessageContext, OutputStream, String) line: 98
> AxisServlet$ProcessRESTRequest.processURLRequest() line: 776
> AxisServlet.doGet(HttpServletRequest, HttpServletResponse) line: 238
> AxisServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse)
> line: 707
> AxisServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 820
> ServletHolder.handle(ServletRequest, ServletResponse) line: 487
> ...
> In RESTUtil, method processURLRequest, the following call is made on line 98
> soapEnvelope = TransportUtils
> .createSOAPMessage(msgContext, null, contentType);
> where the null is supposed to be the input stream
> Thus, when line 49 of ApplicationXMLBuilder in method processDocument is
> encountered,
> PushbackInputStream pushbackInputStream = new
> PushbackInputStream(inputStream);
> where inputStream is null,
> the exception "java.io.IOException: Stream closed" is generated once the
> empty stream is read at line 51
> of ApplicationXMLBuilder:
> if ((b = pushbackInputStream.read()) > 0) {
> For straight Axis use, this issue is a blocker, but I have worked around the
> problem by filtering empty get methods at the servlet level and am populating
> them with content for now.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]