I'm doing a simple authentication on an app built on Play! and Scala. Up until recently, simple authentication was working just fine until I created a manyToManyRelation
in our DB object.
The error:
ExceptionInInitializerError occured : null
The error points to line 2 of this code:
def authenticate(emailAddress:String, password:String) = {
from(DB.users)(u =>
where(u.emailAddress === emailAddress)
select(u)).headOption.flatMap(user => user.passwordMatches(password))
}
The change made to our DB object was this:
val owners =
manyToManyRelation(users, accounts).
via[Owner]((u,a,ua) => (ua.userId === u.id, a.id === ua.accountId))
I'm stumped how this would have an impact since there's no requirement in our code for each user to have an account. Any insight? Thanks.
Found out the bug was deeper in the software stack. This was traced to an error that was fixed with the latest version of Play!
This is the bug fix here in GitHub:
https://github.com/playframework/play/commit/01292ac92022c58da6024ec137fd9c7b68b17c2c