Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-11 Thread Christian Müller
I logged a ticket: https://issues.apache.org/jira/browse/CAMEL-6735

Best,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Sep 11, 2013 at 10:50 AM, Preben.Asmussen  wrote:

> Hi Christian
>
> Thanks - and sorry for the somewhat rough tests. Currently I'm trying to
> solve multiple problems at the same time
>
> And I tried it on 1.12.0 yesterday and there it works as you say. There
> seems to be another problem with tracing on 1.12.0 though. When you
> activate
> tracing using jmx console the tracing seems not to be invoked.
>
> I haven't had the time to dig closer into it, so atm. take this only as a
> hunch that there might be some problems here.
>
> Best,
> Preben
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5739101.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-11 Thread Preben.Asmussen
Ahh - thanks.



--
View this message in context: 
http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5739106.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-11 Thread Claus Ibsen
Hi

Read the release notes
http://camel.apache.org/camel-2120-release.html

See section: Changes that may affect end users

On Wed, Sep 11, 2013 at 10:50 AM, Preben.Asmussen  wrote:
> Hi Christian
>
> Thanks - and sorry for the somewhat rough tests. Currently I'm trying to
> solve multiple problems at the same time
>
> And I tried it on 1.12.0 yesterday and there it works as you say. There
> seems to be another problem with tracing on 1.12.0 though. When you activate
> tracing using jmx console the tracing seems not to be invoked.
>
> I haven't had the time to dig closer into it, so atm. take this only as a
> hunch that there might be some problems here.
>
> Best,
> Preben
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5739101.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-11 Thread Preben.Asmussen
Hi Christian

Thanks - and sorry for the somewhat rough tests. Currently I'm trying to
solve multiple problems at the same time 

And I tried it on 1.12.0 yesterday and there it works as you say. There
seems to be another problem with tracing on 1.12.0 though. When you activate
tracing using jmx console the tracing seems not to be invoked.

I haven't had the time to dig closer into it, so atm. take this only as a
hunch that there might be some problems here.

Best,
Preben



--
View this message in context: 
http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5739101.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-09 Thread Preben.Asmussen
Did 2 tests that shows the problem with enabling the tracer.

If you run RouteWithoutTracerTest it runs ok
The other RouteWithTracerTest fails with  org.xml.sax.SAXParseException:
Premature end of file.

The tracer seems to break stuff somewhere. 

tracerbug.zip
  

btw. run the tests separate in ide due to cxf test port conflicts. But that
another case.

Best,
Preben



--
View this message in context: 
http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5738935.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-06 Thread Preben.Asmussen
Just tested it on 2.11.1 with the same result



--
View this message in context: 
http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5738841.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-06 Thread Preben.Asmussen
Well It didn't work as expected. 

After I added convertBody to byte[] the error persists when enabling
tracing.

Changed route ->





/ns4:now_previus_tracks_response/tracks_list/tracks

/tracks/ns3:channel/source_url


activemq:topic:music.playing.${in.header.channel}

${in.header.channel}
playliste-push-out



Trace ->
[JmsConsumer[TRACK_PLAYING_HUB]] Tracer INFO 
ID-A70103-56878-1378460141699-0-1 >>> (playliste-nnp-out-Route)  -->
split[XPath: /ns4:now_previus_tracks_response/tracks_list/tracks] <<<
Pattern:InOnly, Headers:{JMS_OracleTimestamp=1378460209064,
Server=Apache-Coyote/1.1, JMSExpiration=0, JMSReplyTo=null, JMSType=null,
CamelHttpResponseCode=200, JMSRedelivered=false, JMSXDeliveryCount=1,
JMSDeliveryMode=2, JMSMessageID=ID:E5B4C32C35522667E040650A940D3A3C,
MessageID=DRMAMA, JMSDestination=INTAQ.TRACK_PLAYING_HUB, JMS_OracleDelay=0,
JMSPriority=1, JMSXRecvTimestamp=1378460209275, JMSTimestamp=1378460209064,
JMSXGroupID=null, Content-Type=application/xml, JMSXUserID=INTAQ,
JMS_OracleDeliveryMode=2, Date=Fri, 06 Sep 2013 09:36:49 GMT,
breadcrumbId=ID-A70103-56882-1378460145057-0-1, Content-Length=827,
JMSCorrelationID=null, JMSXState=0, adapterName=playliste-nnp-out},
BodyType:byte[], Body:

[JmsConsumer[TRACK_PLAYING_HUB]] DefaultErrorHandlerERROR Failed
delivery for (MessageId: ID-A70103-56878-1378460141699-0-2 on ExchangeId:
ID-A70103-56878-1378460141699-0-1). Exhausted after delivery attempt: 1
caught: org.apache.camel.TypeConversionException: Error during type
conversion from type: byte[] to the required type: org.w3c.dom.Document with
value [B@2a1ffc2 due org.xml.sax.SAXParseException: Premature end of file.
org.apache.camel.TypeConversionException: Error during type conversion from
type: byte[] to the required type: org.w3c.dom.Document with value
[B@2a1ffc2 due org.xml.sax.SAXParseException: Premature end of file.
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:126)
at
org.apache.camel.builder.xml.XPathBuilder.doGetDocument(XPathBuilder.java:967)
at
org.apache.camel.builder.xml.XPathBuilder.getDocument(XPathBuilder.java:946)
at
org.apache.camel.builder.xml.XPathBuilder.doInEvaluateAs(XPathBuilder.java:790)


It seems that the tracer will read the cxf response stream when tracing gets
enabled resulting in an parseException.

This smells like a in camel-cxf ??

Btw the reason to convert the body to a byte array and not a string is that
the response is in utf-8 including bom. 

Best,
Preben



--
View this message in context: 
http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5738840.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-04 Thread Claus Ibsen
Yeah converting to a String is a good idea if the data is in-memory
only, eg not a 500mb file you read from the file system etc.

A side note:
Also the xpath engine from JDK is purely in-memory only. It cannot
split / evaluate in streaming mode.

You can find some links about splitting big xml files on the Camel
articles page for solutions to this problem.

On Thu, Sep 5, 2013 at 8:31 AM, Preben.Asmussen  wrote:
> Hi Willem
>
> No the tracing was enabled using jmx to trubleshot.
> Thinking of it I recall some bug in Camel with a toString method and
> streaming. It might be that when tracing is enabled it consumes the stream
> when calling toString in camel version 2.10.0 ??
>
> What would be the best approach here to avoid that ?
> Upgrade or would converting to a String just before the split ?
>
> Best,
> Preben
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5738722.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-04 Thread Preben.Asmussen
Hi Willem

No the tracing was enabled using jmx to trubleshot. 
Thinking of it I recall some bug in Camel with a toString method and
streaming. It might be that when tracing is enabled it consumes the stream
when calling toString in camel version 2.10.0 ??

What would be the best approach here to avoid that ?
Upgrade or would converting to a String just before the split ?

Best,
Preben



--
View this message in context: 
http://camel.465427.n5.nabble.com/org-xml-sax-SAXParseException-Premature-end-of-file-in-split-tp5738675p5738722.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: org.xml.sax.SAXParseException: Premature end of file in split

2013-09-04 Thread Willem Jiang
Hi,

Do you always enable to camel tracing in your production environment?

SaxParseException: Premature end of file.  It looks like a stream consuming
issue.
We need to know if the message is consumed before routing the splitter for
processing.



Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem


On Wed, Sep 4, 2013 at 9:00 PM, Preben.Asmussen  wrote:

> Hi
>
> I'm running into a error in production, but not in test while using a
> splitter with a xpath expression.
>
> The route is receiving messages from a jms queue and is calling a rest
> service on anoter tomcat box.
> The response should be splittet and send to an activemq topic ->
> In production I get an SaxParseException: Premature end of file. The same
> deployment runs fine in test.
>
> Route
> 
> 
> 
> 
> 
>
> /ns4:now_previus_tracks_response/tracks_list/tracks
>  method="concat"/>
> 
> resultType="java.lang.String">/tracks/ns3:channel/source_url
> 
>
> activemq:topic:music.playing.${in.header.channel}
> 
> 
>
> Camel version 2.10.0
>
> I wonder if the root cause is that the rest call is streaming the response,
> and if so how best to solve it. ???
> Anybody seen this before.
>
> If it is a streaming problem how to solve it.
> do a convertbody to string before the split, or let the splitter run in
> streaming mode.
>
> btw is xpath able to run in streaming mode ?
>
>
>
>
>
> Camel trace and Stacktrace : --->
> ]
> [JmsConsumer[TRACK_PLAYING_HUB]] 04 Sep. 2013 - 12:46:24,044 INFO
> org.apache.camel.processor.interceptor.Tracer
> [ID-oas10-net-dr-dk-53250-1378291075376-0-5 >>> (playliste-nnp-out-Route)
> direct://audit --> cxfrs://bean:playlist?synchronous=true <<<
> Pattern:InOnly,
> Headers:{breadcrumbId=ID-oas11-net-dr-dk-10395-1378289104952-0-73,
> JMSReplyTo=null, JMSDeliveryMode=2, JMSTimestamp=1378291582482,
> JMSXUserID=INTAQ, JMS_OracleDeliveryMode=2, JMSType=null, JMSXGroupID=null,
> JMS_OracleDelay=0, JMSXState=0, JMS_OracleTimestamp=1378291582482,
> JMSExpiration=0, JMSXRecvTimestamp=1378291584029,
> JMSDestination=INTAQ.TRACK_PLAYING_HUB, JMSRedelivered=false, MessageID=OR,
> JMSPriority=1, JMSXDeliveryCount=1, JMSCorrelationID=null,
> JMSMessageID=ID:E58C42B0AF0D41D4E040650AC90C6296,
> adapterName=playliste-nnp-out}, BodyType:String, Body: encoding="UTF-8"?>
> 2013-09-04T12:43:19
> OR
> 
> 2013-09-04T12:43:19
> 1000209980:2028293
> 701149
> 2200757-0104
>  
> Working On The Highway
> Bruce Springsteen
> 
> 
> 
> 2013-09-04T12:46:29
> 1000209980:2028294
> 720935
> 9006673-0101
>  
> Ask Yourself
> Nabiha
> 
> 
> 
> ]
> [JmsConsumer[TRACK_PLAYING_HUB]] 04 Sep. 2013 - 12:46:25,913 INFO
> org.apache.camel.processor.interceptor.Tracer
> [ID-oas10-net-dr-dk-53250-1378291075376-0-5 >>> (playliste-nnp-out-Route)
> cxfrs://bean:playlist?synchronous=true --> split[XPath:
> /ns4:now_previus_tracks_response/tracks_list/tracks] <<< Pattern:InOnly,
> Headers:{JMSTimestamp=1378291582482, JMSCorrelationID=null,
> JMSXGroupID=null, Transfer-Encoding=chunked, adapterName=playliste-nnp-out,
> JMSXState=0, JMSXRecvTimestamp=1378291584029,
> breadcrumbId=ID-oas11-net-dr-dk-10395-1378289104952-0-73, JMSReplyTo=null,
> JMSType=null, CamelHttpResponseCode=200, Date=Wed, 04 Sep 2013 10:46:25
> GMT,
> JMSRedelivered=false, Server=Apache-Coyote/1.1,
> JMS_OracleTimestamp=1378291582482, MessageID=OR,
> JMSDestination=INTAQ.TRACK_PLAYING_HUB, JMS_OracleDelay=0, JMSPriority=1,
> JMSExpiration=0, JMSXUserID=INTAQ, JMSDeliveryMode=2,
> Content-Type=application/xml, JMS_OracleDeliveryMode=2,
> JMSXDeliveryCount=1,
> JMSMessageID=ID:E58C42B0AF0D41D4E040650AC90C6296},
> BodyType:org.apache.cxf.jaxrs.impl.ResponseImpl, Body: encoding="UTF-8" standalone="yes"?> xmlns:ns2="http://www.dr.dk/namespaces/schemas/common/message_header";
> xmlns:ns3="http://www.dr.dk/namespaces/schemas/common/channel";
> xmlns:ns4="http://dr.dk/service/common/playlister/2010/02
> ">2013-09-04T12:46:24RETRIEVE
> dr.dk/service/playlister
> P4
>
> ØstjyllandAR4radio28124794Smutvejen2013-09-04T12:18:00206371038813Working
> the highwayBruce
>
> Springsteen2013-09-04T12:43:192200757-1-4DALET_NOW [Body clipped after 1000 chars, total length is 17541]]
> [JmsConsumer[TRACK_PLAYING_HUB]] 04 Sep. 2013 - 12:46: