Menu

#85 Identify Column Name or position when Conversion Exception is Thrown

closed
None
5
2017-06-18
2017-06-18
No

Request to be able to identify the column name or position with conversion exception or
To help identify quickly where is the potential error

java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.opencsv.bean.CsvToBean.processProperty(CsvToBean.java:290)
at com.opencsv.bean.CsvToBean.processLine(CsvToBean.java:277)

Discussion

  • Andrew Rucker Jones

    • status: open --> closed
    • assigned_to: Andrew Rucker Jones
     
  • Andrew Rucker Jones

    This is not a conversion error. CsvToBean.processProperty uses introspection to identify the proper setter method for the property in question, then invokes that method. You don't seem to have a setter method that conforms to the Java bean specification. Make sure every property has a setter method, they are all public, they all take exactly one argument of the same type as the property itself, the class is public and not an inner class, and the setter methods are all spelled properly.

    If that doesn't help, feel free to reopen this ticket, but provide more details, please.

     

Log in to post a comment.