Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Camel-bindy Fixed Length Record Unmarshalling gives error

$
0
0
[ thread #2 - JmsConsumer[File]] DefaultErrorHandler ERROR Failed
delivery for (MessageId:
queue_File_ID_L-156037291-55755-1393511224324-1_3_1_1_1 on ExchangeId:
ID-L-156037291-55751-1393511222786-0-3). Exhausted after delivery attempt: 1
caught: java.lang.IllegalArgumentException: Size of the record: 629 is not
equal to the value provided in the model: 627
at
org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat.unmarshal(BindyFixedLengthDataFormat.java:137)
at
org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:57)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

My camel Route

<route>
<from uri="activemq:queue:File"/>
<split>
<tokenize token="\n" group="10"/>
<unmarshal>
<bindy type="Fixed" classType="com.model.Claim"/>
</unmarshal>
<bean ref="example" method="insertFileListItems"/>
</split>
</route>

my bean class

@FixedLengthRecord(length=627)
public class Claim implements Serializable {
... setter getter

my data file

0000000000001010101X CARLOS JAVIER
BARQUERO SANZ AV LISBOA 1 4 D
CACERES 10004 CACERES
198501180608316300 M Sr. 14000000 20100505 A
20100506 00000107000000007708200000000001800000
20150505 20111111360000000012500142 20400505400 714 20111102 20111110
20111111 20111111 20111111 THEFT
GOODS THEFT CONTENT CAPITAL
0000000000001010101X TATIANA
GONZALEZ IBAÑEZ CL DE BOIRO 64
CORDOBA 14014 CORDOBA
195707290605544400 F Sra. 14000000 20100505 A
20100506 00000110000000009284640000000002100000
20150505 20111111300000000007042576 20350505400 712 20111110 20111110
20111111 20111111 20111111 WATER
WATER BUILDING CAPITAL
0000000000001010101X TATIANA
GONZALEZ IBAÑEZ CL DE BOIRO 64
CORDOBA 14014 CORDOBA
195707290605544400 F Sra. 14000000 20100505 A
20100506 00000110000000009284640000000002100000
20150505 20111111300000000007042576 20350505400 712 20111110 20111110
20111111 20111111 20111111 ESTHETICAL
WATER BUILDING CAPITAL

Note ::

My Data file length is 627.

I have checked it properly.

Now the problem is when i am trying to run this project from
fuse-ide(eclipse based ide) using right-click on camel-context.xml and run
it as Local-camel-context it is working fine.

but when i am trying to run the same project using mvn camel:run or deploy
it on server it is giving this 629 length is not matching error.

i think there is some problem of locale / CRLF / etc...

Viewing all articles
Browse latest Browse all 5648

Trending Articles