tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Malcolm <>
Subject Re: Login fails, then works subsequently (Tomcat 7)
Date Wed, 21 Dec 2011 22:23:07 GMT
Here is the line from <GlobalNamingResources> in server.xml:

 <Resource name="jdbc/" auth="Container"
type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
username="*******" password="*********"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://"/>

The http trace would show if the id/pw were different.  But that would
pretty much imply that the browser is messing up what it sends.  I guess
that's always a possibility.  But I haven't changed browsers in months.
And it's sending a saved id/pw in all cases.  the login form appears, and
the id/pw is already filled in.  I hit enter.  I get the logon-failed form,
I hit enter again, and it logs me in.  I just don't see how the browser
after all of these years would just all of a sudden start sending bad id/pw
once, and the start coincides with new version of TC.  Again, I guess
anything could happen.  But I think it's unlikely.  This worked fine for
years with the same db and the same browsers.  Drop in a new TC and it
starts failing.

I don't have a custom realm.  I'm just using the default auth code in TC.
I'm not really excited about writing my own realm code for this or
modifying TC source and rebuilding TC from scratch.  Anybody got a jar file
I can drop in that has realm debug stuff already in it?



On Wed, Dec 21, 2011 at 4:01 PM, Chema <> wrote:

> You can try to set traces into the code of your realm class, if it's a
> custom realm : to watch the query executed ,  to watch the
> user/password passed from browser, to catch exceptions and print stack
> trace ...
> If you dont have a custom realm, you can try to create one for testing
> Can you paste your server.xml conf ? Only realm parts (all), without
> sensible data
> Good luck
> 2011/12/21 Jerry Malcolm <>:
> > About a month ago, I upgraded two different servers from TC 5 to TC 7.
>  The
> > migration went cleanly, and everything has been working fine with the
> > exception of one thing.   About 50% of the time, when I log in to the
> realm
> > for my web app (form-based login), the login will fail.  When I try again
> > with the same id/pw it works.  I can then log out and log back in
> > repeatedly with no problem.  But if I come back later and try to log on
> > again, same things.  Fails once, and then passes.
> >
> > My authentication configuration hasn't changed for years on these
> webapps,
> > and this has worked solid on TC 5.  My database (MySQL) hasn't changed,
> and
> > the user tables are unchanged.  The only thing that has changed is TC 5-
> > -->TC 7.  And the problem has hit both servers, completely independent of
> > each other, other than they both got the TC 7 upgrade.
> >
> > First of all, has anyone ever heard of this situation?  Second, any idea
> > how where/how to turn on detailed tracing/logging of the authentication
> > calls to see what might be going on in the authentication code in TC?
>  The
> > only information I'm getting is that the id/pw were not correct.  But
> > again, same id/pw becomes correct when I submit it a 2nd time.
> >
> > The one thing I didn't change was the MySQL connector.  Should that have
> > been changed for TC 7? (Just guessing now)
> >
> > Suggestions for how to proceed?
> >
> > Thx.
> >
> > Jerry
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message