I was trying to use BeanIO to convert CSV to POJO and found an issue that might help some of you some time.
This is the error i got "Invalid field 'LastName', in record 'user', in stream 'userTemplate': No such property 'LastName' in class 'com.mycompany.beanio.User'"
<beanio xmlns="http://www.beanio.org/2012/03" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xsi:schemaLocation="http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd">
<stream name="userTemplate" format="csv">
<record name="user" class="com.mycompany.beanio.User">
<field name="FirstName"/>
<field name="LastName"/>
<field name="Email" />
</record>
</stream>
</beanio>
this is my java class
package com.mycompany.beanio;
import org.apache.commons.lang3.RandomStringUtils;
import java.math.BigDecimal;
/**
*
* @author Yoash izhack yoashos@gmail.com
*/
class User
{
private String FirstName;
private String LastName;
private String Email;
Get&Set dwon here
As you can see do have the property in my class and yet i have an exception. I explored it and found that the properties that are written from the java class are being uncapitilized for the first char. That means that there was a comparison between lastName to LastName although i wrote LastName twice. a fix was submitted for this bug.