You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jbgill <jb...@q.com> on 2010/04/16 00:07:17 UTC

CXF NMR transport "premature end of file" errors

Hi,

I am seeing some strange errors in the log and on the karaf console when
invoking a CXF endpoint over the CXF NMR transport. Here's the scenario: 
Bundle 1 has a <jaxws:endpoint> with an NMR transport address, and Bundle 2
is trying to invoke an operation on Bundle 1's endpoint via a <jaxws:client>
bean (using the NMR transport address).  It seems that the endpoint is found
and invoked OK, but I get this on the karaf console:

karaf@root> [Fatal Error] :1:1: Premature end of file.
ERROR:  'Premature end of file.'

And I get the full exception trace in the log file (see below for log file
trace).  Is this a bug, or is there something I'm missing?  

I have attached two small projects based on the cxf-nmr and cxf-osgi
examples in the distribution which reproduce the problem.  Bundle 1: 
http://old.nabble.com/file/p28261169/cxf-nmr.tar.gz cxf-nmr.tar.gz   Bundle
2:   http://old.nabble.com/file/p28261169/cxf-callnmr.tar.gz
cxf-callnmr.tar.gz  .  

Thanks,
JB



Here is the trace from the log file:

15:43:41,102 | INFO  | 9@qtp-18522450-0 | NMRConduitOutputStream           |
sport.nmr.NMRConduitOutputStream   91 | invoking service   interface
org.apache.servicemix.examples.cxf.HelloWorld
15:43:41,103 | INFO  | 9@qtp-18522450-0 | NMRConduitOutputStream           |
sport.nmr.NMRConduitOutputStream  103 | create message exchange svc:      
{http://cxf.examples.servicemix.apache.org/}HelloWorldService                                                                                                                                                                                     
15:43:41,104 | INFO  | 9@qtp-18522450-0 | NMRConduitOutputStream           |
sport.nmr.NMRConduitOutputStream  114 | exchange endpoint:
{http://cxf.examples.servicemix.apache.org/}HelloWorldService
15:43:41,104 | INFO  | 9@qtp-18522450-0 | NMRConduitOutputStream           |
sport.nmr.NMRConduitOutputStream  115 | setup message contents on Message []                                            
15:43:41,105 | INFO  | 9@qtp-18522450-0 | NMRConduitOutputStream           |
sport.nmr.NMRConduitOutputStream  117 | service for exchange
{http://cxf.examples.servicemix.apache.org/}HelloWorldService                                                                                                                                                                                                   
15:43:41,105 | INFO  | 9@qtp-18522450-0 | NMRConduitOutputStream           |
sport.nmr.NMRConduitOutputStream  125 | sending message                                                                 
15:43:41,165 | ERROR | loWorld-thread-3 | NMRDestination                   |
cxf.transport.nmr.NMRDestination  119 | error preparing message                                                         
javax.xml.transform.TransformerException: org.xml.sax.SAXParseException:
Premature end of file.                                                                                                      
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:720)                                                                                          
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)                                                                                          
        at
org.apache.servicemix.cxf.transport.nmr.NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java:51)                                                                            
        at
org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:113)
        at
org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86)
        at
org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255)
        at
org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:610)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
        ... 9 more
---------
org.xml.sax.SAXParseException: Premature end of file.
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:610)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
        at
org.apache.servicemix.cxf.transport.nmr.NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java:51)
        at
org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:113)
        at
org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86)
        at
org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255)
        at
org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
15:43:41,180 | WARN  | loWorld-thread-3 | NMR                              |
.servicemix.nmr.core.ChannelImpl  293 | Error processing exchange [
  id:        b652cec4-dcf1-46a6-996a-d801b3b84f59
  mep:       InOut
  status:    Done
  role:      Provider
  target:   
PropertyMatchingReference[{INTERFACE_NAME={http://cxf.examples.servicemix.apache.org/}HelloWorld,
SERVICE_NAME={http://cxf.examples.servicemix.apache.org/}HelloWorldService}]
  operation: {http://cxf.examples.servicemix.apache.org/}sayHi
  In: [
    content: javax.xml.transform.stream.StreamSource@17d4f12
  ]
  Out: [
    content: <?xml version="1.0" encoding="UTF-8"
standalone="no"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayHiResponse
xmlns:ns2="http://cxf.examples.servicemix.apache.org/"><return>Hello Hello
(from outer ws) John
Doe</return></ns2:sayHiResponse></soap:Body></soap:Envelope>
  ]
]

org.apache.servicemix.nmr.api.ServiceMixException:
javax.xml.transform.TransformerException: org.xml.sax.SAXParseException:
Premature end of file.
        at
org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:120)
        at
org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86)
        at
org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255)
        at
org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.transform.TransformerException:
org.xml.sax.SAXParseException: Premature end of file.
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:720)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
        at
org.apache.servicemix.cxf.transport.nmr.NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java:51)
        at
org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:113)
        ... 6 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:610)
        at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
        ... 9 more




-- 
View this message in context: http://old.nabble.com/CXF-NMR-transport-%22premature-end-of-file%22-errors-tp28261169p28261169.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF NMR transport "premature end of file" errors

Posted by jbgill <jb...@q.com>.


iocanel wrote:
> 
> the error you mention usually means 2 things:
> a) either the request is empty.
> b) or you have already read the stream (logging maybe)?
> 

The request is definitely not empty.  The test case I attached previously is
a very simple CXF example where one CXF module calls another using the
cxf-nmr transport, passing a string and getting a string back.  If anyone
has already read the stream and is rereading it, it is the CXF NMR transport
classes.  My test case is based on the two examples included in the
distribution - cxf-nmr and cxf-osgi.  cxf-nmr is pretty much unchanged, and
the cxf-osgi is changed only to insert a <jaxws:client> that is injected and
used to call the endpoint published by cxf-nmr.

-- 
View this message in context: http://old.nabble.com/CXF-NMR-transport-%22premature-end-of-file%22-errors-tp28261169p28267014.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF NMR transport "premature end of file" errors

Posted by iocanel <ca...@upstreamsystems.com>.
Hi,

the error you mention usually means 2 things:
a) either the request is empty.
b) or you have already read the stream (logging maybe)?




-----
Ioannis Canellos
-- 
View this message in context: http://old.nabble.com/CXF-NMR-transport-%22premature-end-of-file%22-errors-tp28261169p28266210.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF NMR transport "premature end of file" errors

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

This is a bug,  create SMX4-520[1] to track it and the fix is coming  
very soon.

Thanks for your great testcase

[1]https://issues.apache.org/activemq/browse/SMX4-520

Freeman
On 2010-4-22, at 下午11:35, jbgill wrote:

>
> Any other ideas anyone?
> -- 
> View this message in context: http://old.nabble.com/CXF-NMR-transport-%22premature-end-of-file%22-errors-tp28261169p28330600.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Re: CXF NMR transport "premature end of file" errors

Posted by jbgill <jb...@q.com>.
Any other ideas anyone?  
-- 
View this message in context: http://old.nabble.com/CXF-NMR-transport-%22premature-end-of-file%22-errors-tp28261169p28330600.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.