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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

tony
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

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/b33a3522-c757-4eab-9b2d-936469a56faf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

tony
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秒寫道:
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 <a href="http://com.fithealth.model.User.id" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcom.fithealth.model.User.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3AuHPOIUr8pB6hmZ4oq680BWt4g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcom.fithealth.model.User.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3AuHPOIUr8pB6hmZ4oq680BWt4g&#39;;return true;">com.fithealth.model.User.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of <a href="http://com.fithealth.model.User.id" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcom.fithealth.model.User.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3AuHPOIUr8pB6hmZ4oq680BWt4g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcom.fithealth.model.User.id\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF3AuHPOIUr8pB6hmZ4oq680BWt4g&#39;;return true;">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

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/68b0fb23-63e3-4858-b61c-226ea1afe710%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.