You can fix that by either making your UserBean inner class 'static' (i.e.
static class UserBean), or by moving it into it's own file. Super CSV is
calling newInstance() on an inner class, which only works if the class is
static.
The code example isn't quite right sorry. We're very close to releasing Super
CSV 2.0.0 which has lots of new features and better documentation and code
examples - stay tuned! (or you can check out the latest code from SVN and take
a look)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Whatever I do, I get the following exception :
Exception in thread "main" Main$UserBean
Error while filling an object context: null offending processor: null
at org.supercsv.io.CsvBeanReader.fillObject(Unknown Source)
at org.supercsv.io.CsvBeanReader.read(Unknown Source)
at Main.main(Main.java:37)
Caused by: java.lang.InstantiationException: Main$UserBean
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
... 3 more
This even occurs when copy pasting the general example from the SuperCSV site
: http://supercsv.sourceforge.net/codeExamples_general.html
Help!
Thanks
A
Hi,
You can fix that by either making your UserBean inner class 'static' (i.e.
static class UserBean), or by moving it into it's own file. Super CSV is
calling newInstance() on an inner class, which only works if the class is
static.
The code example isn't quite right sorry. We're very close to releasing Super
CSV 2.0.0 which has lots of new features and better documentation and code
examples - stay tuned! (or you can check out the latest code from SVN and take
a look)
Thanks for the prompt reply! Yes I figured this out myself however I'm getting
garbage instead of accents. Any ideas?
Looking forward to v2!
Thanks
Would you be able to post your code and CSV input?