Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Login Exception when using JDBC Realm (Glassfish V3.1 + IceFaces 2 + MySQL)

 
Philip Gutierrez
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I am having this weird error when trying to login in using container-managed security using a JDBC Realm, basically was happens is that even though the JDBC realm is set to my login config, it still uses the file realm.

I searching the internet for help, they didn't work for me.

Here's my configuration:

My Login Page:


web.xml security definition:


sun-web.xml security role mapping:


my database table:


My realm configuration:



My Connection Pool Settings:

theRealmPool


Here's the exception:


I was expecting to receive a LoginException: Failed jdbc login for admin

Any suggestion will help.
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Philip,

Did you create appropriate JDBC Connection pool and JDBC Resource in glass fish server. That have connections with your database and JDBC realm?
 
Philip Gutierrez
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fix the problem about detecting the file realm only, I made sure that the JDBC Pool properties are correct and the JNDI name is proper.



But I now get a new exception.



Do I need to create a custom Login Module for this?

Thanks for replying on my post.
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Philip ,

In your JDBCRealm settings JAAS context type should be either jdbcRealm or jdbcDigestRealm(this have to use only when authentication method is DIGEST).

try this and tell what happens..
 
Philip Gutierrez
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Man, I though JAAS Context property was just a unique name for the realm. Silly me.

Thanks for the info.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic