Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4118124
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:55:12+00:00 2026-05-20T22:55:12+00:00

I have a JDBCRealm setup in glasfish 3.1 with oracle11. My web app authentication

  • 0

I have a JDBCRealm setup in glasfish 3.1 with oracle11. My web app authentication works fine, but now I’d like to be able to react if someone fails to login 3 times in a row. Looking at my server log I can see that every time the login fails an exception is logged :

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

Do you guys know any way of catching it programmatically in my java code? I tried googling it, but to no avail.

Or maybe you know a better solution altogether? Please share.

Thanks,
Damo

UPDATE:
I need to re-phrase the question (or explain the situation properly). Every time authentication fails I want to log it in my database. To do that I need the username, timestamp, etc. Every time authentication fails the system will check failures count and if it’s more than 3 it will lock the user’s account. So, I could do it in my loginerror.jsp, but I need the username. Can’t find it anywhere :). So far I experimented with a filter, but it appears that you can’t filter on j_security_check url-patter (at least not in glassfish 3.1). So really, the main issue here is getting the username of the person that failed the login passed to loginerror.jsp (in any form: attribute, parameter, whatever). Will go and experiment with some java script and form submission.. hehe. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:55:13+00:00Added an answer on May 20, 2026 at 10:55 pm

    You can only catch it if you take the login in your hands. Instead of submitting the form to j_security_check, you need to submit to a servlet which uses HttpServletRequest#login().

    try {
        request.login(username, password);
    } catch (ServletException e) {
        // Handle.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set a JDBCRealm for web-app inside tomcat, and when I reload it
I have JSF web app on glassfish using j_security_check validation with jdbcRealm on glassfish
have been trying couple of hours now to make my iphone app universal. The
I have GlassFish set up to use JDBCRealm. The configuration looks like this and
Have an option to choose either a windows SE or Web Edition to install,
have been playing with Cubepoints (wordpress plugin) and have installed the ranks module but
Have a singleton class for BNRItemStore, but when I tried to call it, I
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.