java.lang.IllegalArgumentException in Grails after database import

458 views Asked by At

I've imported some data from CSV file to MYSQL database. The data is imported properly. But then I run my application corresponding to that database, it gives java.lang.IllegalArgumentException on each Domain related method. For example

Contacts contact = Contacts.get(id);
Contacts.count(), etc

Here I checked if it is getting id properly as well as checked the database with the same id. Database has the record with same id. But in grails application it gives IllegalArgumentException. How to solve this issue?

1

There are 1 answers

0
user3853055 On

the IllegalArgumentException I was getting was not enough to understand the problem. So I turned on Hibernate Logging and then understood the problem. I had some primitive type of fields in the domain, in which the NULL value was stored while loading CSV file. Due to which I got the above exception.