• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Tomcat authenticationn failing with correct credentials

Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could not be more irritating... my test environment produces expected results and an application that works. In my production I am not getting authentication to work.I am testing authentication by creating a new user and then attempting to log them in with the correct credentials.

what happens?
I get nothing but the login error page defined in web.xml indicating that the authentication failed. I get nothing in my logs and not even a bubbled exception.

how is my realm configured?
with the following context.xml:

All urls,databases and ttable names are correct as have been checked MANY times.

What do I think could be wrong?
not a tomcat bug but my hosting providers (eapps.com) configuration of tomcat. Of course it is difficult to gwt them to buy it but here is why I think this...

Originally, I wanted hibernate to use a <resource> defined datasource in server.xml global resources and this failed.There was a workaround because hibernate can manage it's own pool but with authentication there is none as this is pure container with no plugins to do this. In short , I do not think tomcat is finding any <resources> in server.xml or context.xml Does anyone have a clue as to what is going on?

some more info production an test containers are same version , same jdbc lib jar, exact same database names, table names, column names and user names to narrow down possibilities of errors.
Saloon Keeper
Posts: 25653
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, a really secure system isn't going to give you any hints about security. Hints can be exploited. If you know how to make something blow up, you're found a weak spot, as many stack-overflow hackers have known to their glee. So if if blows up, no information to that effect may be passed back to the requester.

If things are truly as identical as you say, there's one of 2 possibilities I'd look for first.

1. No route from tomcat server to database server. Either because the client physically can't communicate or because DNS doesn't resolve.

2. Blocked route from tomcat server to database server. E. g., firewalls

Of course, these are pretty unlikely when the database is on localhost. But this is mysql, so there are 2 other possibilities;

3. MySQL isn't accepting local requests on port 3306 (BTW, I though it was 3305???)

4. The client doesn't have MySQL access rights for that userid, password, AND HOST on that database.

One one the first things, therefore, that I'd try would be to connect using a local-machine copy of the mysql command-line add, if that's possible.

When all else fails, crank Tomcat's logging level (not the webapp's, but Tomcat's logging level). Set it to debug. The Realm should provide the feedback you need. Just remember to reset it afterwards for security reasons.
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic