Search code examples
jakarta-eejsf-2glassfish-3

GlassFish 3.1.2.2 JDBC Realm Error


I am trying to configure JDBC Realm in my JSF application and i followed, read multiple blogs but i get the below error in all the cases.

SEVERE: jdbcrealm.invaliduserreason WARNING: WEB9102: Web Login Failed: >com.sun.enterprise.security.auth.login.common.LoginException: Login failed: Security Exception

I referred both the below links

http://jugojava.blogspot.in/2011/02/jdbc-security-realm-with-glassfish-and.html

http://blog.eisele.net/2011/01/jdbc-security-realm-and-form-based.html

LoginException: Login failed: Security Exception

My JDBC Connection Pool Pings, and i have specified the realm inside Configuration > Server-config. I have specified the JAAS context as jdbcRealm. I have specified the JNDI name as the JDBC Resource Name. I have specified the Password Encryption Algorithm = SHA-256 (also tried MD5) I have specified the Encoding as Hex (also tried Base64) I have specified the Digest Algorithm as none (also tried with SHA-256)

(I have a very basic web.xml and tried both sun-web.xml/glassfish-web.xml)

Can some one let me know where should i troubleshoot to solve the problem, Is there a way to check if the Realm is getting connected to the database and the log for the Realm (i mean what happens when the control goes to Realm and from there to the database etc).


Solution

  • I don't know how the Glassfish Realm works for others, but to solve my problem i had to add the schema name & table name for the user_table and group_table.

    Like (in the jdbcRealm) user-table = schema.user_table group-table = schema.group_table