Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 98103 invoked from network); 3 Mar 2008 21:12:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2008 21:12:49 -0000 Received: (qmail 13275 invoked by uid 500); 3 Mar 2008 21:12:33 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 13251 invoked by uid 500); 3 Mar 2008 21:12:33 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 13236 invoked by uid 99); 3 Mar 2008 21:12:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 13:12:33 -0800 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of delbd+jakarta@oma.be does not designate 195.238.6.170 as permitted sender) Received: from [195.238.6.170] (HELO mailrelay004.isp.belgacom.be) (195.238.6.170) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 21:11:53 +0000 X-Belgacom-Dynamic: yes Received: from 145.6-179-91.adsl-dyn.isp.belgacom.be (HELO [10.0.0.4]) ([91.179.6.145]) by relay.skynet.be with ESMTP; 03 Mar 2008 22:12:02 +0100 Message-ID: <47CC69A2.4080301@oma.be> Date: Mon, 03 Mar 2008 22:12:02 +0100 From: david delbecq User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Configuring DataSourceRealm using Oracle References: <7eaaa5400803030934h6ceb9cb4gf3cbf130ba127f11@mail.gmail.com> <47CC3F60.9030101@oma.be> <7eaaa5400803031203w57140969lb6c49a84c063ee15@mail.gmail.com> <47CC5B66.2000405@oma.be> <7eaaa5400803031253n2b31b47fsa0fe1d5fe95e4a6e@mail.gmail.com> In-Reply-To: <7eaaa5400803031253n2b31b47fsa0fe1d5fe95e4a6e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org What is in the web.xml is not tomcat specific. The "realm" you see in web.xml is related to the notion of realm used by http protocol, that is a string showed to user when the login with http basic authentification, and which server for browser to seperate login in different "realms" for a same server (eg an admin realm, a shopping realm, a clerk realms) The link between a webapplication and a tomcat realm (that is, a source for users passwords and roles) is done in a context.xml file, which is tomcat specific. The file can be either located in META-INF/context.xml in your webapp for auto configuration or be put manually in tomcat config (conf/Catalina//.xml) Jason Ling a �crit : > Thank you, David. Now it works! > > I looked back into the documentation for DataSource, and then configured one > in the server.xml file as a JNDI . It seems to me that the > gets associated with the by jdbc/webappDB, and that tells > tomcat server where to find the Oracle server. > > Nevertheless, I still still have a few questions: > > What is the the sub-element of for in the > application's web.xml file, when and how is it used? Suppose I configure > more than one in server.xml, is that the scenario where I need to > use the tag to specify which Realm to use? In that case, > what is the name for the realm? > > Thanks a lot for your guide! > > > Jason > > > > On Mon, Mar 3, 2008 at 3:11 PM, david delbecq wrote: > > >> And, actually, you didn't do the part where you configure the datasource >> that your realm will use, information that is provided in the link i >> pointed you to. If you did actually configure the datasource (which is >> separate from the datasourcerealm), you wouldn't say >> >> >>> I still wonder >>> how Tomcat would know where to go >>> >> moreover none of the configuration statements you pasted show any track >> of your datasource configuration, which agina is separate from the realm. >> >> >> Jason Ling a �crit : >> >>> Thank you, David. >>> >>> Sorry, I sent this message two times, each time only the quoted message >>> >> was >> >>> sent, but not my reply. This is another try. >>> >>> Actually I did read the document you provided the link to. In that >>> >> document >> >>> (The Realm Component) the following attributes are listed for the >>> DataSourceRealm: >>> >>> dataSourceName >>> roleNameCol >>> userCredCol >>> userNameCol >>> userRoleTable >>> userTable >>> >>> and I actually used all of them in my first attempted configuration as >>> >> shown >> >>> in my original email: >>> >>> First attempt: >>> ++++++++++ >>> I replaced the above-mentioned element with the following >>> >> one, >> >>> mimicking the example for mySQL in the documentation: >>> >>> >> dataSourceName="jdbc/webappDB" >>> userTable="users" userNameCol="user_name" >>> userCredCol="user_pass" >>> userRoleTable="user_roles" roleNameCol="role_name" /> >>> >>> And that did not work out, you know, as I mentioned. I still do not >>> >> know >> >>> what was wrong with my configuration for DataSourceRealm. I still >>> >> wonder >> >>> how Tomcat would know where to go to look for the users table and the >>> user_roles table, which are on the Oracle server which is >>> >> sb.lehman.cuny.edu, >> >>> and is not in any of the attributes listed above. Did I miss any >>> >> components >> >>> in the configuration that I tried? >>> >>> >>> Jason >>> >>> >>> >>> On Mon, Mar 3, 2008 at 1:11 PM, David Delbecq >>> >> wrote: >> >>> >>>> Jason Ling a �crit : >>>> >>>> >>>>> I changed the element in the server.xml file, and it became: >>>>> >>>>> >>>> dataSourceName="jdbc/webappDB" >>>>> driverName="oracle.jdbc.OracleDriver" >>>>> connectionURL="jdbc:oracle:thin:@sb.lehman.cuny.edu:1521 >>>>> >> :idm0" >> >>>>> connectionName="webappdb" connectionPassword="GreenHorn" >>>>> userTable="users" userNameCol="user_name" >>>>> userCredCol="user_pass" >>>>> userRoleTable="user_roles" roleNameCol="role_name" /> >>>>> >>>>> >>>>> >>>>> >>>> your are using the datasourcerealm with parameters from the jdbcrealm, >>>> those are two separate realms. For datasource realm, you need to define >>>> a datasource that matches the one specified in >>>> >>>> dataSourceName="jdbc/webappDB" >>>> >>>> To get more information on how to configure a datasource, please go >>>> there: >>>> >>>> >>>> >> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html >> >>>> --------------------------------------------------------------------- >>>> To start a new topic, e-mail: users@tomcat.apache.org >>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >>>> For additional commands, e-mail: users-help@tomcat.apache.org >>>> >>>> >>>> >>>> >>> >> --------------------------------------------------------------------- >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> >> >> > > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org