Saturday, December 04, 2010

Spring Roo "Integer cannot be cast to Long" problem

I'm a newbie on Spring Roo and while trying to create an application using Spring  Roo and Vaadin, I've suddenly started getting the following message from Spring Roo Shell:
"java.lang.Integer cannot be cast to java.lang.Long"

And all my spring roo environment stopped to work.

After "googling" a lot, I've finally found one possible reason to this problem, at least it was my case. So I'd like to share.

In my case I've annotated some fields with @Min(1) or @Max(9) for example, and what I didn't know is that those annotation takes a long parameter not a integer parameter.

Then after changing @Min(1) to @Min(1L), the same to @Max annotations, the problem has gone and my spring roo environment got working again.

Thanx to this post http://www.manning-sandbox.com/thread.jspa?threadID=39831&tstart=0

0 comentários: