You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "David Webb (JIRA)" <ji...@apache.org> on 2010/10/16 20:32:24 UTC

[jira] Commented: (AXIS2-4854) Cannot read IncomingAttachmentInputStream from Inbound Attachments

    [ https://issues.apache.org/jira/browse/AXIS2-4854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921731#action_12921731 ] 

David Webb commented on AXIS2-4854:
-----------------------------------

Here is the DEBUG output from the call:

14:13:45,001 DEBUG [BuilderUtil] Input contentType (multipart/related; type="text/xml"; start="<B3F6630025B648CAD3402B8544ECFDEE>"; 	boundary="----=_Part_2_10998346.1287252824975")
14:13:45,001 DEBUG [BuilderUtil] CharSetEncoding defaulted (UTF-8)
14:13:45,001 DEBUG [TransportUtils] createSOAPEnvelope using Builder (class org.apache.axis2.builder.MIMEBuilder) selected from type (multipart/related)
14:13:45,002 DEBUG [BuilderUtil] Creating an Attachments map.
14:13:45,006 DEBUG [Attachments] Attachments contentLength=0, contentTypeString=multipart/related; type="text/xml"; start="<B3F6630025B648CAD3402B8544ECFDEE>"; 	boundary="----=_Part_2_10998346.1287252824975"
14:13:45,017 DEBUG [Attachments] boundary=------=_Part_2_10998346.1287252824975
14:13:45,017 DEBUG [Attachments] getSOAPPartContentID rootContentID=<B3F6630025B648CAD3402B8544ECFDEE>
14:13:45,021 DEBUG [PartFactory] Start createPart()
14:13:45,021 DEBUG [PartFactory]   isSOAPPart=true
14:13:45,021 DEBUG [PartFactory]   thresholdSize= 0
14:13:45,021 DEBUG [PartFactory]   attachmentDir=null
14:13:45,021 DEBUG [PartFactory]   messageContentLength 0
14:13:45,021 DEBUG [PartFactory] initHeaders
14:13:45,023 DEBUG [PartFactory] addHeader: (Content-Type) value=(text/xml; charset=UTF-8)
14:13:45,024 DEBUG [PartFactory] addHeader: (Content-Transfer-Encoding) value=(binary)
14:13:45,024 DEBUG [PartFactory] addHeader: (Content-Id) value=(<B3F6630025B648CAD3402B8544ECFDEE>)
14:13:45,024 DEBUG [PartFactory] End initHeaders
14:13:45,028 DEBUG [AbstractPart] getHeader name=(content-id) value=(<B3F6630025B648CAD3402B8544ECFDEE>)
14:13:45,030 DEBUG [Attachments] getSOAPPartContentID rootContentID=<B3F6630025B648CAD3402B8544ECFDEE>
14:13:45,030 DEBUG [AbstractPart] getHeader name=(content-type) value=(text/xml; charset=UTF-8)
14:13:45,030 DEBUG [BuilderUtil] Input contentType (text/xml; charset=UTF-8)
14:13:45,030 DEBUG [BuilderUtil] CharSetEncoding from content-type (UTF-8)
14:13:45,030 DEBUG [Attachments] getSOAPPartContentID rootContentID=<B3F6630025B648CAD3402B8544ECFDEE>
14:13:45,031 DEBUG [AbstractPart] getContentTransferEncoding()
14:13:45,031 DEBUG [AbstractPart] getHeader name=(content-transfer-encoding) value=(binary)
14:13:45,031 DEBUG [AbstractPart]  CTE =binary
14:13:45,032 DEBUG [PartOnMemoryEnhanced] Start Decoding stream
14:13:45,032 DEBUG [BuilderUtil] char set encoding set from default =UTF-8
14:13:45,032 DEBUG [StAXUtils] XMLStreamReader is org.apache.axiom.util.stax.dialect.WoodstoxStreamReaderWrapper
14:13:45,032 DEBUG [StAXSOAPModelBuilder] Starting to process SOAP 1.1 message
14:13:45,033 DEBUG [StAXSOAPModelBuilder] Build the OMElement Envelope by the StaxSOAPModelBuilder
14:13:45,033 DEBUG [StAXSOAPModelBuilder] Build the OMElement Body by the StaxSOAPModelBuilder
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking pre-condition for Phase "Transport"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking phase "Transport"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'RequestURIBasedDispatcher' in Phase 'Transport'
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'SOAPActionBasedDispatcher' in Phase 'Transport'
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking post-conditions for phase "Transport"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking pre-condition for Phase "Addressing"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking phase "Addressing"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'AddressingBasedDispatcher' in Phase 'Addressing'
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking post-conditions for phase "Addressing"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking pre-condition for Phase "Security"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking phase "Security"
14:13:45,033 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking post-conditions for phase "Security"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking pre-condition for Phase "PreDispatch"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking phase "PreDispatch"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking post-conditions for phase "PreDispatch"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking pre-condition for Phase "Dispatch"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking phase "Dispatch"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'RequestURIBasedDispatcher' in Phase 'Dispatch'
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'SOAPActionBasedDispatcher' in Phase 'Dispatch'
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'RequestURIOperationDispatcher' in Phase 'Dispatch'
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'SOAPMessageBodyBasedDispatcher' in Phase 'Dispatch'
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking Handler 'HTTPLocationBasedDispatcher' in Phase 'Dispatch'
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking post-conditions for phase "Dispatch"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking pre-condition for Phase "RMPhase"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking phase "RMPhase"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking post-conditions for phase "RMPhase"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking pre-condition for Phase "OperationInPhase"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking phase "OperationInPhase"
14:13:45,034 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Checking post-conditions for phase "OperationInPhase"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() in Phase "OperationInPhase"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() in Phase "RMPhase"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() in Phase "Dispatch"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'HTTPLocationBasedDispatcher' in Phase 'Dispatch'
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'SOAPMessageBodyBasedDispatcher' in Phase 'Dispatch'
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'RequestURIOperationDispatcher' in Phase 'Dispatch'
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'SOAPActionBasedDispatcher' in Phase 'Dispatch'
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'RequestURIBasedDispatcher' in Phase 'Dispatch'
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() in Phase "PreDispatch"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() in Phase "Security"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() in Phase "Addressing"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'AddressingBasedDispatcher' in Phase 'Addressing'
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() in Phase "Transport"
14:13:45,035 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'SOAPActionBasedDispatcher' in Phase 'Transport'
14:13:45,036 DEBUG [Phase] [MessageContext: logID=urn:uuid:43EB5A3D10872110791287252825087] Invoking flowComplete() for Handler 'RequestURIBasedDispatcher' in Phase 'Transport'
14:13:45,036 DEBUG [StAXSOAPModelBuilder] Build the OMElement runReportResponse by the StaxSOAPModelBuilder
14:13:45,036 DEBUG [StAXSOAPModelBuilder] Build the OMElement runReportReturn by the StaxSOAPModelBuilder
14:13:45,037 DEBUG [OMXMLStreamReaderValidator] An END_ELEMENT event for {http://axis2.ws.jasperserver.jaspersoft.com}runReportResponse was encountered.  But this does match the corresponding START_ELEMENT runReportReturn event.
14:13:45,135 DEBUG [ReportManager] <?xml version="1.0" encoding="UTF-8"?>
<operationResult version="2.0.1">
	<returnCode><![CDATA[0]]></returnCode>
</operationResult>

14:13:45,138 DEBUG [PartFactory] Start createPart()
14:13:45,138 DEBUG [PartFactory]   isSOAPPart=false
14:13:45,138 DEBUG [PartFactory]   thresholdSize= 0
14:13:45,138 DEBUG [PartFactory]   attachmentDir=null
14:13:45,138 DEBUG [PartFactory]   messageContentLength 0
14:13:45,138 DEBUG [PartFactory] initHeaders
14:13:45,140 ERROR [STDERR] org.apache.axiom.om.OMException: java.io.IOException: Attempted read on closed stream.
14:13:45,140 ERROR [STDERR] 	at org.apache.axiom.attachments.impl.PartFactory.createPart(PartFactory.java:172)
14:13:45,140 ERROR [STDERR] 	at org.apache.axiom.attachments.Attachments.getPart(Attachments.java:705)
14:13:45,141 ERROR [STDERR] 	at org.apache.axiom.attachments.Attachments.getNextPartDataHandler(Attachments.java:623)
14:13:45,141 ERROR [STDERR] 	at org.apache.axiom.attachments.Attachments.getDataHandler(Attachments.java:350)

> Cannot read IncomingAttachmentInputStream from Inbound Attachments
> ------------------------------------------------------------------
>
>                 Key: AXIS2-4854
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4854
>             Project: Axis2
>          Issue Type: Bug
>    Affects Versions: 1.5.1
>         Environment: WSDL2CODE 1.4.1 generated stubs
> Running inside:
> JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634
> Java version: 1.6.0_18,Sun Microsystems Inc.
> Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
> Java VM: Java HotSpot(TM) 64-Bit Server VM 16.0-b13,Sun Microsystems Inc.
> OS-System: Windows 7 6.1,amd64
> VM arguments: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:49743 -javaagent:C:\Program Files (x86)\ZeroTurnaround\JRebel\jrebel.jar -Xverify:none -Drebel.struts1-plugin=true -Dorg.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dprogram.name=run.bat -Djava.endorsed.dirs=C:/jboss-5.1.0.GA/bin/../lib/endorsed -Xms1024m -Xmx1024m -XX:NewRatio=3 -XX:PermSize=128m -XX:MaxPermSize=256m -Dfile.encoding=Cp1252 
> Axis2 1.5.1
> Axiom 1.2.9
>            Reporter: David Webb
>
> I am using Axis2 to call a webservice on jasperserver (Jasper Reports).  The web service that I am calling works fine with stub generated for Axis.  I have discovered this issue trying to upgrade all my clients to Axis2.
> The webservice I am calling returns an attachment in the MessageContext with the contentID of "jasperPrint".  When I try to access this attachment using either the attachments.getIncomingAttachmentStreams, or the attachments.getDataHandler("jasperPrint"),  I get the following Exception when trying to read the input stream.
>  java.io.IOException: Attempted read on closed stream.
> 	at org.apache.commons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:183)
> 	at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:107)
> 	at java.io.FilterInputStream.read(FilterInputStream.java:116)
> 	at org.apache.axiom.om.util.DetachableInputStream.read(DetachableInputStream.java:147)
> 	at java.io.FilterInputStream.read(FilterInputStream.java:116)
> 	at java.io.PushbackInputStream.read(PushbackInputStream.java:169)
> 	at org.apache.axiom.attachments.BoundaryDelimitedStream.readFromStream(BoundaryDelimitedStream.java:207)
> 	at org.apache.axiom.attachments.BoundaryDelimitedStream.read(BoundaryDelimitedStream.java:294)
> 	at org.apache.axiom.attachments.IncomingAttachmentInputStream.read(IncomingAttachmentInputStream.java:128)
> 	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
> 	at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
> 	at java.io.FilterInputStream.read(FilterInputStream.java:90)
> Here is the example code that generated the problem.
> 				IncomingAttachmentStreams streams = InContext.attachments.getIncomingAttachmentStreams();
> 				boolean bFound = false;
> 				while (streams != null && streams.isReadyToGetNextStream() && !bFound) {
> 					
> 					IncomingAttachmentInputStream stream = streams.getNextStream();
> 					
> 					Log.write(this, DEBUG, stream.getContentId());
> 					
> 					if (stream.getContentId().equals("<jasperPrint>")) {
> 						
> 						DataHandler dh = new DataHandler(new InputStreamDataSource(stream));
> 						
> 						ObjectInputStream obj = new ObjectInputStream(dh.getInputStream());
> 						
> 						attach = (JasperPrint)obj.readObject();
> 						bFound = true;
> 					}
> 					
> 				}

-- 
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org