play framework 1.2.4 - illegal argument exception

76 views
Skip to first unread message

Jash

unread,
Jun 23, 2012, 11:57:21 AM6/23/12
to play-fr...@googlegroups.com
I'm learning the play framework by making a stack overflow clone. The schema is Area (eg. programming) -> Language(eg. java) -> Question -> Answer

But when I try to add a question for Java:
Language language = Language.findById(langId) 
gives:
IllegalArgumentException occured : id to load is required for loading

It's not able to get the language.id for Java. When I check my Mysql db, Java is assigned id=1. Why is it not able to get the id?

I'm guessing the controller gets the id from the url, and my url doesn't have the id for the language. Currently my routes are set as:
/Area (Eg., Programming)
/Language (Eg., Java)
/Questions (list of all questions related to Java)

If this is the case, how do I add the id of the master to the slave's url? i.e., my questions url should have id for 'Programming' (areaId=1) and for Java (languageId=1)?
Reply all
Reply to author
Forward
0 new messages