File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes JDBCRealm Oracle problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JDBCRealm Oracle problem" Watch "JDBCRealm Oracle problem" New topic

JDBCRealm Oracle problem

Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
Here is the server.xml file I set up:

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
connectionURL="jdbc RCL"
userTable="TOMCAT_USERS" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="TOMCAT_USER_ROLES" roleNameCol="role_name" />

The problem is that I can connect to that string with userid/password thru my servlets - so the connect info is right. But if I copy this in server.xml and try to set up JDBCRealm to Oracle 9i with setting classpath
(to be safe) in Tomcat 5.0. It does not work. It says can not open database when I connect to my test web page.

What could be wrong? I tested it and works on my PC when I have Oracle/tomcat on the same box.But now on tomcat box I do not have Oracle. I just copied oracle drivers at right location and start tomcat starts fine no error.

Has some one installed Tomcat on one machine and connected to Oracle on another UNIX machine and set up JDBCRealm as mentioned in Tomcat book.

Need help on this one.

Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
Since i struggled hard on this w/o much help. Here is the problem I had:

1. Oracle drivers were not in lib directory of container.
2. My password had a reserved word "$". That was blowing up JDBCRealm even though another version of application that was unprotected worked fine. As soon as I changed that in server.xml to a vlaue not using this it worked fine.

Overall, I think Tomcat being a freeware is becoming unmanagble for our project as there is not much help and really one needs to spend hours to dig issues like this .... I hate this unproductive Java programming and love old Powerbuilder when we can turn these applications in no time with point and click.
I agree. Here's the link:
subject: JDBCRealm Oracle problem
jQuery in Action, 3rd edition