You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by SreenuM <sr...@gmail.com> on 2009/01/11 16:12:22 UTC

Premature end of file, while sending xml thru soap message

Hi I am geeting "org.xml.sax.SAXParseException: Premature end of file
exception" while unmarshaling the the xml content int my
MessageExchangeListener implementer class...

Here is the exception. Code to process XML is give after this exception 
---------------
org.apache.cxf.interceptor.Fault: Premature end of file.
        at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:149)
        at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:56)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
        at
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:295)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:258)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceTransformer.java:262)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer.java:175)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:311)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMElement(SourceTransformer.java:361)
        at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:72)
        ... 20 more
[Fatal Error] :-1:-1: Premature end of file.
---------------

code
******
InOut inOut = (InOut) exchange;
InOut inOut = (InOut) exchange;
NormalizedMessage normalizedMessage = inOut.getInMessage(); 
SourceTransformer sourceTransformer = new SourceTransformer();
inMessage = sourceTransformer.contentToString(normalizedMessage);
ContractDocument cDoc = ContractDocument.Factory.parse(inMessage );

*************

Sys details
WinXP, apache-servicemix-3.3.1, Weblogic10.0, apache-maven-2.0.9,
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)..
 
Please find the solution to parse the xmlMessage..
-- 
View this message in context: http://www.nabble.com/Premature-end-of-file%2C-while-sending-xml-thru-soap-message-tp21400287p21400287.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Premature end of file, while sending xml thru soap message

Posted by Freeman Fang <fr...@gmail.com>.
SreenuM wrote:
> Hi I am geeting "org.xml.sax.SAXParseException: Premature end of file
> exception" while unmarshaling the the xml content int my
> MessageExchangeListener implementer class...
>
> Here is the exception. Code to process XML is give after this exception 
> ---------------
> org.apache.cxf.interceptor.Fault: Premature end of file.
>         at
> org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:149)
>         at
> org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:56)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
>         at
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)
>         at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>         at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:295)
>         at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:258)
>         at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>         at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>         at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>         at org.mortbay.jetty.Server.handle(Server.java:324)
>         at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>         at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>         at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
> Caused by: org.xml.sax.SAXParseException: Premature end of file.
>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceTransformer.java:262)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer.java:175)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:311)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMElement(SourceTransformer.java:361)
>         at
> org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:72)
>         ... 20 more
> [Fatal Error] :-1:-1: Premature end of file.
> ---------------
>
> code
> ******
> InOut inOut = (InOut) exchange;
> InOut inOut = (InOut) exchange;
> NormalizedMessage normalizedMessage = inOut.getInMessage(); 
> SourceTransformer sourceTransformer = new SourceTransformer();
> inMessage = sourceTransformer.contentToString(normalizedMessage);
>   
Can you print out the inMessage here?
The error shows it's not an vaild xml message.
Freeman
> ContractDocument cDoc = ContractDocument.Factory.parse(inMessage );
>
> *************
>
> Sys details
> WinXP, apache-servicemix-3.3.1, Weblogic10.0, apache-maven-2.0.9,
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)..
>  
> Please find the solution to parse the xmlMessage..
>