Re: JDBCRealm Question
Hi Alan, Try using connectionName and connectionPassword rather than passing that info in the URL. Tomcat is probably sticking a user= and password= onto the end of your url resulting in: jdbc:mysql://localhost:3306/diamond?user=alan;password=xxx?user=;passw ord= which blows up when it tries to get a connection. The realm tag should look like: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost:3306/diamond connectionName=alan connectionPassword=xxx userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Hope that helps, Rick - Original Message - From: Alan Halley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 08, 2002 9:55 AM Subject: JDBCRealm Question Hi I am getting strange error when I try to use JDCRealm. I running Tomcat 4 from within Forte. The error is Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver LifecycleException: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615) I'm sure that my JDBCrealm is configured correctly. Here is the relevant section of the server.xml Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost:3306/diamond?user=alan;password=xx x; userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Any help would be gratefully appreciated. Alan Halley -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JDBCRealm Question
Hi Rick I'm still getting the same eror. My context in server.xml is as follows Context path= docBase=D:\forteprojects\tomcat401_base\webapps\diamond debug=99 Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/diamond connectionName=alan connectionPassword=xxx userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Valve className=org.netbeans.modules.web.monitor.catalina.MonitorValve / InstanceListenerorg.netbeans.modules.web.monitor.catalina.DispatchListener /InstanceListener Logger className=org.apache.catalina.logger.FileLogger prefix=localhost__log. suffix=.txt timestamp=true / /Context Alan - Original Message - From: Rick Fincher [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, October 08, 2002 3:32 PM Subject: Re: JDBCRealm Question Hi Alan, Try using connectionName and connectionPassword rather than passing that info in the URL. Tomcat is probably sticking a user= and password= onto the end of your url resulting in: jdbc:mysql://localhost:3306/diamond?user=alan;password=xxx?user=;passw ord= which blows up when it tries to get a connection. The realm tag should look like: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost:3306/diamond connectionName=alan connectionPassword=xxx userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Hope that helps, Rick - Original Message - From: Alan Halley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 08, 2002 9:55 AM Subject: JDBCRealm Question Hi I am getting strange error when I try to use JDCRealm. I running Tomcat 4 from within Forte. The error is Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver LifecycleException: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615) I'm sure that my JDBCrealm is configured correctly. Here is the relevant section of the server.xml Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost:3306/diamond?user=alan;password=xx x; userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Any help would be gratefully appreciated. Alan Halley -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JDBCRealm Question
Hi Alan, It may be just a typo but the connectionURL you have listewd below doesn't have a port number in it. Other than that, it looks correct, assuming that you are using the correct mysql driver name. Also, Forte runs a version of Tomcat that is configured to run inside the development environment. There may be a problem there. If you can, try your realm definition on a stand-alone version of Tomcat. If it works there, then the Forte setup is the problem. You can syntax check the server.xml file in Forte by clicking on the runtime tab in the explorer, then expanding Installed Servers, expanding Tomcat 4.0 and right clicking on the one you are using (probably Internal). Select Configure (edit server.xml) from the popup list. The file will open in the editor and all the tags should be blue. If there is an error the code will be greyed out. Rick - Original Message - From: Alan Halley [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, October 08, 2002 3:21 PM Subject: Re: JDBCRealm Question Hi Rick I'm still getting the same eror. My context in server.xml is as follows Context path= docBase=D:\forteprojects\tomcat401_base\webapps\diamond debug=99 Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/diamond connectionName=alan connectionPassword=xxx userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Valve className=org.netbeans.modules.web.monitor.catalina.MonitorValve / InstanceListenerorg.netbeans.modules.web.monitor.catalina.DispatchListener /InstanceListener Logger className=org.apache.catalina.logger.FileLogger prefix=localhost__log. suffix=.txt timestamp=true / /Context Alan - Original Message - From: Rick Fincher [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, October 08, 2002 3:32 PM Subject: Re: JDBCRealm Question Hi Alan, Try using connectionName and connectionPassword rather than passing that info in the URL. Tomcat is probably sticking a user= and password= onto the end of your url resulting in: jdbc:mysql://localhost:3306/diamond?user=alan;password=xxx?user=;passw ord= which blows up when it tries to get a connection. The realm tag should look like: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost:3306/diamond connectionName=alan connectionPassword=xxx userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Hope that helps, Rick - Original Message - From: Alan Halley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 08, 2002 9:55 AM Subject: JDBCRealm Question Hi I am getting strange error when I try to use JDCRealm. I running Tomcat 4 from within Forte. The error is Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver LifecycleException: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615) I'm sure that my JDBCrealm is configured correctly. Here is the relevant section of the server.xml Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost:3306/diamond?user=alan;password=xx x; userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/ Any help would be gratefully appreciated. Alan Halley -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JDBCRealm question
The UnsatisfiedLinkError is usually an indication that LD_LIBRARY_PATH is not set properly (if on *nix) and/or ORACLE_HOME is not set correctly. If you are on Windows, also add %ORACLE_HOME%\bin to your path. -Original Message- From: Koes, Derrick [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 10:13 AM To: '[EMAIL PROTECTED]' Subject: JDBCRealm question According to the directions in the documentation, you should put the jar that contains the JDBC driver in common/lib if you need it for authentication as well as for your webapp. If I do this, I cannot use startup.bat because I get: Exception during startup processing java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) Caused by: java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410) However, if I add it to server/lib and in my webapp's lib I get an exception stating that it was already loaded by another classloader when my webapp tries to use it. I'm using the famous Oracle classes12.jar for Oracle 9i release 1. Has anyone had similar problems? How do you make tomcat see the ocijdbc9 library in the shared mode? Thanks, Derrick This electronic transmission is strictly confidential to Smith Nephew and intended solely for the addressee. It may contain information which is covered by legal, professional or other privilege. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JDBCRealm Question
Subject: Re: JDBCRealm Question From: Vic C. [EMAIL PROTECTED] === Working sample showing JDBC relms and user table CRUD with SQL (in a single table like you want) is on sourceforge.com basicportal project. (It also has Struts MVC with JSTL) Vic Mete Kural wrote: Hello, My question is about how the user roles are deterermined in JDBCRealm. In the basic XML file configuration, the XML files has an element roles. All of the user's roles are provided in this element as a comma-seperated list. It seems to me that in JDBCRealm, this is not the case. User_role column of the User_Roles table only stores one user role at a time. For instance if somebody has both the roles user and admin, in the XML file this would be specified as user, admin inside the roles element. My understanding is that in JDBCRealm, you have to enter multiple records relating to the same user, i.e. username for each role that the user has. Is there a way to tweak JDBCRealm to read one comma-seperated list string from only one row instead of reading a row for each role that the user has. Why did I need this kind of functionality? Because I want to keep my user data including the user role all in one table and not deal with a seperate table for user_roles. Is what I want possible? Or do you have a suggestion on how to manage my user_roles data in the relational database? Thanks, Mete Kural __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JDBCRealm Question
Hi Vic, Thanks for the lead. Though what is the name of the project? Is it basicportal? I couldn't find it on sourceforge. Would you be able to provide me a URL? Thanks, Mete --- Jakarta Tomcat Newsgroup [EMAIL PROTECTED] wrote: Subject: Re: JDBCRealm Question From: Vic C. [EMAIL PROTECTED] === Working sample showing JDBC relms and user table CRUD with SQL (in a single table like you want) is on sourceforge.com basicportal project. (It also has Struts MVC with JSTL) Vic Mete Kural wrote: Hello, My question is about how the user roles are deterermined in JDBCRealm. In the basic XML file configuration, the XML files has an element roles. All of the user's roles are provided in this element as a comma-seperated list. It seems to me that in JDBCRealm, this is not the case. User_role column of the User_Roles table only stores one user role at a time. For instance if somebody has both the roles user and admin, in the XML file this would be specified as user, admin inside the roles element. My understanding is that in JDBCRealm, you have to enter multiple records relating to the same user, i.e. username for each role that the user has. Is there a way to tweak JDBCRealm to read one comma-seperated list string from only one row instead of reading a row for each role that the user has. Why did I need this kind of functionality? Because I want to keep my user data including the user role all in one table and not deal with a seperate table for user_roles. Is what I want possible? Or do you have a suggestion on how to manage my user_roles data in the relational database? Thanks, Mete Kural __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JDBCRealm Question
On Mon, 22 Jul 2002, Mete Kural wrote: Date: Mon, 22 Jul 2002 16:20:48 -0700 (PDT) From: Mete Kural [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: JDBCRealm Question Hello, My question is about how the user roles are deterermined in JDBCRealm. In the basic XML file configuration, the XML files has an element roles. All of the user's roles are provided in this element as a comma-seperated list. It seems to me that in JDBCRealm, this is not the case. User_role column of the User_Roles table only stores one user role at a time. For instance if somebody has both the roles user and admin, in the XML file this would be specified as user, admin inside the roles element. My understanding is that in JDBCRealm, you have to enter multiple records relating to the same user, i.e. username for each role that the user has. Is there a way to tweak JDBCRealm to read one comma-seperated list string from only one row instead of reading a row for each role that the user has. You are correct about your reasoning that JDBCRealm wants a separate row for each user+role combination. That is very typical of the result of normalizing data structures for storage in a DBMS, so you will see this design pattern a lot as you work with different database-based applications. In fact, many XML purists would frown on the fact that we didn't normalize the data structure in the XML file by having nested role elements inside each user element :-). But, given backwards compatibility requirements, it's too late now. Why did I need this kind of functionality? Because I want to keep my user data including the user role all in one table and not deal with a seperate table for user_roles. Is what I want possible? Or do you have a suggestion on how to manage my user_roles data in the relational database? You would seem to have the following choices: * Bite the bullet and maintain a user_roles table as well. (Even if you avoid learning how to deal with master/detail relationships for this app, you're definitely going to need to understand how to do this for other situations). * Make a stored procedure (if your database supports them) that automatically updates the user_roles table whenever you update the user table. That way, your administrative program doesn't need to worry about it, and JDBCRealm still gets what it needs. * Make your own custom version of JDBCRealm that knows about a single comma-delmited column, and maintain it yourself. There is nothing in the standard version that does this. Thanks, Mete Kural Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JDBCRealm Question
Ignacio, I have done a cvs checkout, downloaded ant 1.3 (previously I had 1.2) and attempted the build. I get: - BUILD FAILED Could not create task of type: copy because I can't find it in the list of task class definitions - What am I doing wrong? Peter Ignacio J. Ortega wrote: I tinkered with this on my redhat 7.0 box with tomcat 3.3M2 and postgresql 7.1. The static method mentioned in the HOWTO is not `Digest' but `digest' (thank you jikes). I have not verified that the Please file a bug in http://nagoya.apache.org/bugzilla to track this issue, TIA digested passwords work, because a) tomcat 3.3M3 fails for me immediately aftetr authentication anyway, and b) there is no Check the lastest nightly build for 3.3..auth is working for me without problems...if you have any problems ...please file a bug to be able to track the issue..if exist now.. mention of `Digest' as an attribute of ContextInterceptor in server.dtd, and I suspect that the correct name for the attribute is `digest', as with the metehod. I have not bothered to get the code to check this. Server.dtd is outdated ..sorry, it's not easy to have a dtd for tomcat, we are waiting for the release stabilize to be able to have a accurate dtd ... Thanks for the feedback.. Saludos , Ignacio J. Ortega -- Peter B. West [EMAIL PROTECTED] http://powerup.com.au/~pbwest Lord, to whom shall we go?
RE: JDBCRealm Question
Probably you have another (old very old) copy of the ant jars, somewhere in your classpath.check that..the problem you have is about ant, sure... Saludos , Ignacio J. Ortega -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]En nombre de Peter B. West Enviado el: viernes 27 de abril de 2001 7:33 Para: [EMAIL PROTECTED] Asunto: Re: JDBCRealm Question Ignacio, I have done a cvs checkout, downloaded ant 1.3 (previously I had 1.2) and attempted the build. I get: - BUILD FAILED Could not create task of type: copy because I can't find it in the list of task class definitions - What am I doing wrong? Peter Ignacio J. Ortega wrote: I tinkered with this on my redhat 7.0 box with tomcat 3.3M2 and postgresql 7.1. The static method mentioned in the HOWTO is not `Digest' but `digest' (thank you jikes). I have not verified that the Please file a bug in http://nagoya.apache.org/bugzilla to track this issue, TIA digested passwords work, because a) tomcat 3.3M3 fails for me immediately aftetr authentication anyway, and b) there is no Check the lastest nightly build for 3.3..auth is working for me without problems...if you have any problems ...please file a bug to be able to track the issue..if exist now.. mention of `Digest' as an attribute of ContextInterceptor in server.dtd, and I suspect that the correct name for the attribute is `digest', as with the metehod. I have not bothered to get the code to check this. Server.dtd is outdated ..sorry, it's not easy to have a dtd for tomcat, we are waiting for the release stabilize to be able to have a accurate dtd ... Thanks for the feedback.. Saludos , Ignacio J. Ortega -- Peter B. West [EMAIL PROTECTED] http://powerup.com.au/~pbwest Lord, to whom shall we go?
RE: JDBCRealm Question
I tinkered with this on my redhat 7.0 box with tomcat 3.3M2 and postgresql 7.1. The static method mentioned in the HOWTO is not `Digest' but `digest' (thank you jikes). I have not verified that the Please file a bug in http://nagoya.apache.org/bugzilla to track this issue, TIA digested passwords work, because a) tomcat 3.3M3 fails for me immediately aftetr authentication anyway, and b) there is no Check the lastest nightly build for 3.3..auth is working for me without problems...if you have any problems ...please file a bug to be able to track the issue..if exist now.. mention of `Digest' as an attribute of ContextInterceptor in server.dtd, and I suspect that the correct name for the attribute is `digest', as with the metehod. I have not bothered to get the code to check this. Server.dtd is outdated ..sorry, it's not easy to have a dtd for tomcat, we are waiting for the release stabilize to be able to have a accurate dtd ... Thanks for the feedback.. Saludos , Ignacio J. Ortega
Re: JDBCRealm Question
Hi Christian, Here's an example of my login-config setup to use HTML forms: login-config auth-methodFORM/auth-method realm-namePrivate Authentication Area/realm-name form-login-config form-login-page/login/login.jsp/form-login-page form-error-page/login/error.jsp/form-error-page /form-login-config /login-config With this setup, all attempts to access docs in my protected area get redirected to /login/login.jsp. All login errors go to /login/error.jsp. I'm not sure about encrypted passwords. You may have to take a look at the class that implements the JDBCRealm and do some customization -- encrypt the password before the call is made to the DB. I'm also not sure what session object it creates. There's a simple example in the examples.war package that comes with the distribution. If you have the examples package in your TOMCAT_HOME/webapps directory, the path to the example is /webapps/examples/jsp/security. The web.xml entries are in /webapps/examples/WEB-INF/web.xml. Thanks, --jeff - Original Message - From: Christian Hargraves [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 25, 2001 8:17 AM Subject: JDBCRealm Question I have read the JDBCRealm.howto file, but I still have a few questions. in the application's web.xml file there is a login-config tag. 1) What do I set the login-config tag in the web.xml file to so that it will use JDBCRealm? 2) We have encrypted passwords. How would we configure JDBCRealm to handle them? 3) What session object does JDBCRealm create and what is the name of session object it creates once authenticated. 4) Is there an example app out there that uses an HTML form to handle the authentication? Thanks so much for all of your time Christian
RE: JDBCRealm Question
Thank you very much for your help Jeff. Can I see the important part of your login.jsp page too? That's the missing link. I think if we can get the password, encrypt it, then have JDBCRealm handle it, it will work. Thanks a ton for your help. -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 25, 2001 12:43 PM To: [EMAIL PROTECTED] Subject: Re: JDBCRealm Question Hi Christian, Here's an example of my login-config setup to use HTML forms: login-config auth-methodFORM/auth-method realm-namePrivate Authentication Area/realm-name form-login-config form-login-page/login/login.jsp/form-login-page form-error-page/login/error.jsp/form-error-page /form-login-config /login-config With this setup, all attempts to access docs in my protected area get redirected to /login/login.jsp. All login errors go to /login/error.jsp. I'm not sure about encrypted passwords. You may have to take a look at the class that implements the JDBCRealm and do some customization -- encrypt the password before the call is made to the DB. I'm also not sure what session object it creates. There's a simple example in the examples.war package that comes with the distribution. If you have the examples package in your TOMCAT_HOME/webapps directory, the path to the example is /webapps/examples/jsp/security. The web.xml entries are in /webapps/examples/WEB-INF/web.xml. Thanks, --jeff - Original Message - From: Christian Hargraves [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 25, 2001 8:17 AM Subject: JDBCRealm Question I have read the JDBCRealm.howto file, but I still have a few questions. in the application's web.xml file there is a login-config tag. 1) What do I set the login-config tag in the web.xml file to so that it will use JDBCRealm? 2) We have encrypted passwords. How would we configure JDBCRealm to handle them? 3) What session object does JDBCRealm create and what is the name of session object it creates once authenticated. 4) Is there an example app out there that uses an HTML form to handle the authentication? Thanks so much for all of your time Christian
Re: JDBCRealm Question
Christian Hargraves wrote: I have read the JDBCRealm.howto file, but I still have a few questions. .. 2) We have encrypted passwords. How would we configure JDBCRealm to handle them? I tinkered with this on my redhat 7.0 box with tomcat 3.3M2 and postgresql 7.1. The static method mentioned in the HOWTO is not `Digest' but `digest' (thank you jikes). I have not verified that the digested passwords work, because a) tomcat 3.3M3 fails for me immediately aftetr authentication anyway, and b) there is no mention of `Digest' as an attribute of ContextInterceptor in server.dtd, and I suspect that the correct name for the attribute is `digest', as with the metehod. I have not bothered to get the code to check this. Peter -- Peter B. West [EMAIL PROTECTED] http://powerup.com.au/~pbwest Lord, to whom shall we go?