JDBCRealms in Tomcat 4
Hi,
just to make things sure in the beginning, my problem is not to get JDBCRealms to work ;) My Problem is to get several of them up and running - if it is possible.
Im using Tomcat 4 with mod_webapp through Apache. Everything works fine. But i need several JDBCRealms for different servlets. The only place where i could get the JDBCRealm to work is in the Tomcat-Apache <service>-Entry in the server.xml.
Though, there is just on Tomcat-Apache-Service, but several servlets. So i guess there must be a way to define the JDBCRealm Servlet-specific out of this Service-Entry. In former times - running Tomcat 3 - i put the JDBCRealm into the web.xml in the webapp-dir of the regarding servlet. Though - Tomcat 4 ignores any Realm i put there.
So, where can i define a Servlet-Specific Realm how ?
regards,
Cedric
[870 byte] By [
Cedric_] at [2007-9-19]

> Cedric, do you mean web application if you say
> servlet? While i don't know a way to configure a realm
Yes.
> http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/context.html ).
Ok, thanks, that's it. There are days where you better leave the Server alone ;) My problems depend on the Fact that i don't have any Context defined ;)
*cu
Cedric
I have tried to setup a realm and in server.xml of Tomcat 4, I wrote:
...
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="COM.ibm.db2.jdbc.app.DB2Driver"
connectionURL="jdbc:db2:CRISAN"
connectionName="crisan"
connectionPassword="parola"
userTable="users" userNameCol="user_name"
userCredCol="user_pass"
userRoleTable="users_roles" roleNameCol="role_name" />
...
to configure the Realm.
Every table is corectly created in db2 but when i try to start Tomcat, I get the following error:
"Starting service Tomcat-Standalone
Apache Tomcat/4.0.3
Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path
LifecycleException: Exception opening database connection: java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path
java.lang.Throwable()
java.lang.Exception()
org.apache.catalina.LifecycleException(java.lang.String, java.lang.Throwable)
void org.apache.catalina.realm.JDBCRealm.start()
void org.apache.catalina.core.ContainerBase.start()
void org.apache.catalina.core.StandardEngine.start()
void org.apache.catalina.core.StandardService.start()
void org.apache.catalina.core.StandardServer.start()
void org.apache.catalina.startup.Catalina.start()
void org.apache.catalina.startup.Catalina.execute()
void org.apache.catalina.startup.Catalina.process(java.lang.String [])
java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object [])
void org.apache.catalina.startup.Bootstrap.main(java.lang.String [])
java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object [])
void com.silbergrau.tomcat.TomcatRunner.start(java.lang.String [], java.lang.String)
void com.silbergrau.tomcat.TomcatRunner.main(java.lang.String [])
java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object [])"
If you have the answer to mine, I would appreciate your help or any suggestion.
A million thankx in advance,
Sincerly,
Marius C.