Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Stream already closed when enable MTOM!  RSS feed

 
kathir Pitchaimani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have developed a webservice is used to upload document, its working fine normally. But when i enable MTOM on soapui getting the below exception. i have hosted my webservice on weblogic 10.3.0.
the below exception always indicates last line of my soap request(ie; </soapenv:Envelope>). Strangly the application hosted on the same weblogic 10.3.0 is working with MTOM enabled. i checked the version fo java and weblogic everything is same.
have tried many ways, but no luck.
java.lang.IllegalStateException: Stream already closed
at org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(DataHead.java:197)
at org.jvnet.mimepull.DataHead$ReadMultiStream.read(DataHead.java:172)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at java.io.PushbackInputStream.read(PushbackInputStream.java:169)
at weblogic.xml.babel.reader.XmlReader$Utf8Reader.read(XmlReader.java:660)
at weblogic.xml.babel.reader.XmlReader.read(XmlReader.java:496)
at weblogic.xml.babel.scanner.ScannerState.read(ScannerState.java:400)
at weblogic.xml.babel.scanner.ScannerState.expect(ScannerState.java:238)
at weblogic.xml.babel.scanner.CloseTag.read(CloseTag.java:21)
at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:256)
at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
at weblogic.xml.babel.baseparser.StartElement.parse(StartElement.java:77)
at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:453)
at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
at com.sun.xml.ws.encoding.MtomCodec$MtomXMLStreamReaderEx.next(MtomCodec.java:423)
at com.sun.istack.XMLStreamReaderToContentHandler.bridge(XMLStreamReaderToContentHandler.java:154)
at com.sun.xml.ws.message.stream.StreamMessage.writePayloadTo(StreamMessage.java:369)
at com.sun.xml.ws.message.stream.StreamMessage.writeTo(StreamMessage.java:459)
at com.sun.xml.ws.message.AbstractMessageImpl.readAsSOAPMessage(AbstractMessageImpl.java:193)
at com.sun.xml.ws.handler.SOAPMessageContextImpl.getMessage(SOAPMessageContextImpl.java:84)
at weblogic.wsee.jaxws.framework.jaxrpc.SOAPMessageContext.getMessage(SOAPMessageContext.java:145)
at weblogic.wsee.security.wssp.handlers.WssHandler.getSecurityContext(WssHandler.java:239)
at weblogic.wsee.security.wssp.handlers.WssHandler.preValidate(WssHandler.java:341)
at weblogic.wsee.security.wssp.handlers.PreWssServerPolicyHandler.processRequest(PreWssServerPolicyHandler.java:25)
at weblogic.wsee.security.wssp.handlers.WssHandler.handleRequest(WssHandler.java:92)
at weblogic.wsee.jaxws.framework.jaxrpc.TubeFactory$JAXRPCTube.processRequest(TubeFactory.java:183)
at weblogic.wsee.jaxws.tubeline.FlowControlTube.processRequest(FlowControlTube.java:75)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:134)
at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:272)
at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:185)
at weblogic.wsee.jaxws.JAXWSServlet.doPost(JAXWSServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at weblogic.wsee.jaxws.JAXWSServlet.service(JAXWSServlet.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3504)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
amount read:0inputBufferSize3451overflow256
Error at line:39 col:21 Got character[0] expected a valid XML character
at weblogic.xml.babel.scanner.ScannerState.checkedRead(ScannerState.java:625)
at weblogic.xml.babel.scanner.CharData.read(CharData.java:65)
at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:296)
at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
at weblogic.xml.babel.baseparser.StartElement.parse(StartElement.java:77)
at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:453)
at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
at com.sun.xml.ws.encoding.MtomCodec$MtomXMLStreamReaderEx.next(MtomCodec.java:423)
at com.sun.istack.XMLStreamReaderToContentHandler.bridge(XMLStreamReaderToContentHandler.java:154)
at com.sun.xml.ws.message.stream.StreamMessage.writePayloadTo(StreamMessage.java:369)
at com.sun.xml.ws.message.stream.StreamMessage.writeTo(StreamMessage.java:459)
at com.sun.xml.ws.message.AbstractMessageImpl.readAsSOAPMessage(AbstractMessageImpl.java:193)
at com.sun.xml.ws.handler.SOAPMessageContextImpl.getMessage(SOAPMessageContextImpl.java:84)
at weblogic.wsee.jaxws.framework.jaxrpc.SOAPMessageContext.getMessage(SOAPMessageContext.java:145)
at weblogic.wsee.security.wssp.handlers.WssHandler.getSecurityContext(WssHandler.java:239)
at weblogic.wsee.security.wssp.handlers.WssHandler.preValidate(WssHandler.java:341)
at weblogic.wsee.security.wssp.handlers.PreWssServerPolicyHandler.processRequest(PreWssServerPolicyHandler.java:25)
at weblogic.wsee.security.wssp.handlers.WssHandler.handleRequest(WssHandler.java:92)
at weblogic.wsee.jaxws.framework.jaxrpc.TubeFactory$JAXRPCTube.processRequest(TubeFactory.java:183)
at weblogic.wsee.jaxws.tubeline.FlowControlTube.processRequest(FlowControlTube.java:75)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:134)
at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:272)
at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:185)
at weblogic.wsee.jaxws.JAXWSServlet.doPost(JAXWSServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at weblogic.wsee.jaxws.JAXWSServlet.service(JAXWSServlet.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3504)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: javax.xml.stream.XMLStreamException: Error at line:39 col:21 Got character[0] expected a valid XML character
at com.sun.xml.ws.handler.SOAPMessageContextImpl.getMessage(SOAPMessageContextImpl.java:88)
at weblogic.wsee.jaxws.framework.jaxrpc.SOAPMessageContext.getMessage(SOAPMessageContext.java:145)
at weblogic.wsee.security.wssp.handlers.WssHandler.getSecurityContext(WssHandler.java:239)
at weblogic.wsee.security.wssp.handlers.WssHandler.preValidate(WssHandler.java:341)
at weblogic.wsee.security.wssp.handlers.PreWssServerPolicyHandler.processRequest(PreWssServerPolicyHandler.java:25)
at weblogic.wsee.security.wssp.handlers.WssHandler.handleRequest(WssHandler.java:92)
at weblogic.wsee.jaxws.framework.jaxrpc.TubeFactory$JAXRPCTube.processRequest(TubeFactory.java:183)
at weblogic.wsee.jaxws.tubeline.FlowControlTube.processRequest(FlowControlTube.java:75)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:134)
at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:272)
at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:185)
at weblogic.wsee.jaxws.JAXWSServlet.doPost(JAXWSServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at weblogic.wsee.jaxws.JAXWSServlet.service(JAXWSServlet.java:64)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3504)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.xml.soap.SOAPException: javax.xml.stream.XMLStreamException: Error at line:39 col:21 Got character[0] expected a valid XML character
at com.sun.xml.ws.message.AbstractMessageImpl.readAsSOAPMessage(AbstractMessageImpl.java:195)
at com.sun.xml.ws.handler.SOAPMessageContextImpl.getMessage(SOAPMessageContextImpl.java:84)
... 33 more
Caused by: javax.xml.stream.XMLStreamException: Error at line:39 col:21 Got character[0] expected a valid XML character
at com.sun.xml.ws.message.stream.StreamMessage.writePayloadTo(StreamMessage.java:378)
at com.sun.xml.ws.message.stream.StreamMessage.writeTo(StreamMessage.java:459)
at com.sun.xml.ws.message.AbstractMessageImpl.readAsSOAPMessage(AbstractMessageImpl.java:193)
... 34 more
Caused by: javax.xml.stream.XMLStreamException: Error at line:39 col:21 Got character[0] expected a valid XML character
at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:206)
at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)
at com.sun.xml.ws.encoding.MtomCodec$MtomXMLStreamReaderEx.next(MtomCodec.java:423)
at com.sun.istack.XMLStreamReaderToContentHandler.bridge(XMLStreamReaderToContentHandler.java:154)
at com.sun.xml.ws.message.stream.StreamMessage.writePayloadTo(StreamMessage.java:369)
... 36 more
Caused by: Error at line:39 col:21 Got character[0] expected a valid XML character
at weblogic.xml.babel.scanner.ScannerState.checkedRead(ScannerState.java:625)
at weblogic.xml.babel.scanner.CharData.read(CharData.java:65)
at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:296)
at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:178)
at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:533)
at weblogic.xml.babel.baseparser.StartElement.parse(StartElement.java:77)
at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java:453)
at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:326)
at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)

Definitely someone should have faced and solved this issue. Please help me to resolve this issue.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect that this error message is the important one:


It cites a specific line and column in the input document - what is at that location?

Bill
 
kathir Pitchaimani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Last line of my soap request,
</soapenv:Envelope>

The same request works without mtom, but when I enable mtom in soapui getting this error
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
</soapenv:Envelope>

Is 19 characters, the error says column 21

If this was my problem I would use an editor capable of displaying characters in HEX to see what columns 19, 20 and 21 actually contain.

I also wonder why it is trying to parse past the closing > - that should close the root element of the XML and the parser should stop.

Bill
 
kathir Pitchaimani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's my issue. My question is why this is happening when enable mtom. I tried to see any extra character after closing '>'. But see nothing in notepad or any other editor. But no luck.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then I would say there is a flaw in the MTOM implementation that SOAPui is providing. If it works in a more realistic client - server environment, perhaps this problem is not worth pursuing.
 
kathir Pitchaimani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but the same code works in another weblogic instance thru soapui with the same request. i have two weblogic instances per region. working on one instance but not in other.
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kathir Pitchaimani wrote:But see nothing in notepad or any other editor.

Notepad won't show non-printable characters. Did you try a hex editor like William suggested ?
 
kathir Pitchaimani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i check the soapui log the request goes like
</soapenv:Envelope>[\r][\n]"
the position it indicates '[' this one. But the same works when MTOM is disabled. When i enable MTOM then error points this character.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!