confuse env setting of grail run-app command and java -jar app.war (produce by package cm)

9 views
Skip to first unread message

tony lu

unread,
Oct 24, 2016, 10:43:47 AM10/24/16
to Grails Dev Discuss
Hi, 

 I encounter a very confusing situation.
 Everything works under the grails prod run-app,
 However, when I run the war by using grails package, lots of strange error come out.
 Like the following error occured when application start up.

 ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.orm.hibernate5.HibernateSystemException: IllegalArgumentException occurred calling getter of com.fithealth.model.User.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.fithealth.model.User.id
 
but it works if I use grails prod run-app, the data can be build into my mysql when BootStrap runing. 
 
 I really need your help to out of this problem, if you would ever met.
 Any help will be appraciate,
Best regards,
tony

tony lu

unread,
Oct 24, 2016, 10:54:51 AM10/24/16
to Grails Dev Discuss
here is the domain class 


class User {
Long id;
String email;
String name;
Date dateOfBirth;
enum Gender {FEMALE,MALE,NONE}
Gender gender = Gender.NONE;
float weight;
float height;

static constraints = {
email nullable: false
name nullable: false
dateOfBirth()
}

static mapping = {
id generator:'increment'
users lazy: false
}
}

tony lu於 2016年10月24日星期一 UTC+8下午10時43分47秒寫道:
Reply all
Reply to author
Forward
0 new messages