Hello!
Here is the mapping file I am using:
<stream name="blahblah" format="csv">
<parser>
<property name="delimiter" value="|" />
</parser>
<record name="foobar" minOccurs="1" maxOccurs="unbounded" class="blah">
<field name="someNumber" type="java.lang.Long" format="#0" />
<field name="somethingElse" />
</record>
</stream>
</beanio>
Here is the input:
156000033 |Hello World
And this is the exception I am seeing:
Invalid 'someNumber': Type conversion error: Invalid Long value '156000033 '
at org.beanio.internal.parser.UnmarshallingContext.validate(UnmarshallingContext.java:196)
at org.beanio.internal.parser.BeanReaderImpl.internalRead(BeanReaderImpl.java:105)
at org.beanio.internal.parser.BeanReaderImpl.read(BeanReaderImpl.java:64)
at org.apache.camel.dataformat.beanio.BeanIODataFormat.readModels(BeanIODataFormat.java:148)
at org.apache.camel.dataformat.beanio.BeanIODataFormat.unmarshal(BeanIODataFormat.java:110)
....
If I pass in a format pattern to the field, shouldn't it parse correctly in NumberTypeHandler? I get this in Java 1.6 and BeanIO 2.0.1.
Thanks!
Paolo