• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBCRealm Oracle Error ORA-01403 - no data found

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created a small web application that uses Tomcat-managed authentication via JDBCRealm. When I use the following realm descriptor, and go to the web application's site, I am prompted to log in and everything works great.





Now I am trying to use my employer's oracle database with this realm descriptor:



When I try to access the web application with the oracle back end, I am prompted to log in, but denied access. Using wireshark, I have determined that the oracle database is throwing the following exception: ORA-01403 (no data found - typically results when no rows are returned). However querying the actual tables shows that they have the same information in them as is the case for the web application with the postgresql backend. Furthermore if I remove authentication from the web.xml, I can access the oracle database just fine from the web application. In fact, the web application allows me to query and update the oracle tables (user_logins and the user_roles) without difficulty.

As it turns out, our company's intranet uses tomcat-managed authentication (different user/schema, but same domain and data instance), and this works fine.

I am baffled as to why no rows are returned when Tomcat tries to authenticate. I have located the appropriate JDBC drivers in $CATALINA_HOME/lib. Any suggestions as to how to troubleshoot this would be appreciated.

Deb Platt
 
deb platt
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat-managed authentication with the oracle backend started working. I did not know what action on my part caused this to happen. However after it started working, I started looking at my table definitions and decided to re-do the definition of the tables. The now-working oracle columns were of type VARCHAR. I dropped the tables and re-did the columns as VARCHAR2. I went to log in to the web application, and authentication now failed. I then stopped the web app via Tomcat manager and restarted it. Authentication began working again. I don't know what kind of handshake goes on between the Tomcat server and the Oracle database server, but apparently more information is exchanged a textual representation of the table names and columns.

As to whether something like this caused my original problem, it does not seem likely because I was actually undeploying the entire application, then redeploying it. However I was fiddling with the data types used in the table definitions so perhaps my original problem was that I began by using CHAR data types in both the postgresql backend and the oracle backend, and I'm beginning to wonder if usernames matched in postgresql but not oracle because trailing white space were treated differently during the authentication process with the different databases. Now I am using TEXT data types in postgresql and VARCHAR2 data types in orcacle so there are no trailing white space issues, and the Tomcat-managed authentication works for both the oracle and postgresql backends.

Deb
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic