I have the exactly same problem with JDBC Realm.
Until JDBC realm is specified as default realm, I get exception "... javax.security.auth.login.LoginException: Failed file login for [my-user-name]".
When JDBC realm is specified as default realm, authorization works OK.
[Message sent by forum member 'cvoronin' (cvoronin)]
http://forums.java.net/jive/thread.jspa?messageID=284029