Re: Configuring a DataSourceRealm
Hello Christopher, It worked. Thanks very much for the tips. have a nice day Paulo Vivacqua On 5/29/07, Propes, Barry L <[EMAIL PROTECTED]> wrote: I don't believe you can have both, Paulo...i believe it's one realm or the other if I'm not mistaken. -Original Message- From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 1:07 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Configuring a DataSourceRealm Hi David, The "j_security_check is not a real page it´s a key for communicating with tomcat. I lookup all my code and there is no reference to JNDI jdbc. If I comment my Realm declaration on server.xml i get to the login page without any problem, and the authentication works, but the user info is retrieved from the tomcat-users file not from the database. I have my realm declaration placed right below the on my server.xml. Is it in the right place? can I have both? thanks again On 5/29/07, David Short <[EMAIL PROTECTED]> wrote: > Somewhere in your code, probably in j_security_check, there is a reference > to a datasource, which will reference the JNDI value. You need to change > that reference from jdbc to jdbc/oaso. > > -Original Message- > From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 29, 2007 10:46 AM > To: Tomcat Users List; [EMAIL PROTECTED] > Subject: Re: Configuring a DataSourceRealm > > Hi David, Thanks for the help. > > I don´t have a reference to JNDI jdbc on my code. What I have is a login > page with a form that´s sent to tomcat for authentication. > > > > > > > > I restarted tomcat and what I am getting a login window for TomCat Manager > Application. I tried using the a user and a password configured on > tomcat-users but none of them work. > > the application error: > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > do-dist: > dist: > F:\Paulo\ICESP\6sem\java\projetos\RealmJdbcTeste\nbproject\build-impl.xml:45 > 2: > Deployment error: > Access to Tomcat server has not been authorized. Set the correct username > and password with the "manager" role in the Tomcat customizer in the Server > Manager. > See the server log for details. > BUILD FAILED (total time: 57 seconds) > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > the tomcat error > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > 29/05/2007 14:39:23 org.apache.catalina.realm.DataSourceRealm open > SEVERE: Exception performing authentication > javax.naming.NameNotFoundException: Name jdbc is not bound in this Context > at org.apache.naming.NamingContext.lookup(NamingContext.java:769) > at org.apache.naming.NamingContext.lookup(NamingContext.java:152) > at > org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) > at > org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java: > 282) > at > org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe > nticator.java:180) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase > .java:490) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 > ) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 > ) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java > :107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC > onnection(Http11BaseProtocol.java:664) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav > a:527) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo > rkerThread.java:80) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav > a:684) > at java.lang.Thread.run(Thread.jav
RE: Configuring a DataSourceRealm
I don't believe you can have both, Paulo...i believe it's one realm or the other if I'm not mistaken. -Original Message- From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 1:07 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Configuring a DataSourceRealm Hi David, The "j_security_check is not a real page it´s a key for communicating with tomcat. I lookup all my code and there is no reference to JNDI jdbc. If I comment my Realm declaration on server.xml i get to the login page without any problem, and the authentication works, but the user info is retrieved from the tomcat-users file not from the database. I have my realm declaration placed right below the on my server.xml. Is it in the right place? can I have both? thanks again On 5/29/07, David Short <[EMAIL PROTECTED]> wrote: > Somewhere in your code, probably in j_security_check, there is a reference > to a datasource, which will reference the JNDI value. You need to change > that reference from jdbc to jdbc/oaso. > > -Original Message- > From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 29, 2007 10:46 AM > To: Tomcat Users List; [EMAIL PROTECTED] > Subject: Re: Configuring a DataSourceRealm > > Hi David, Thanks for the help. > > I don´t have a reference to JNDI jdbc on my code. What I have is a login > page with a form that´s sent to tomcat for authentication. > > > > > > > > I restarted tomcat and what I am getting a login window for TomCat Manager > Application. I tried using the a user and a password configured on > tomcat-users but none of them work. > > the application error: > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > do-dist: > dist: > F:\Paulo\ICESP\6sem\java\projetos\RealmJdbcTeste\nbproject\build-impl.xml:45 > 2: > Deployment error: > Access to Tomcat server has not been authorized. Set the correct username > and password with the "manager" role in the Tomcat customizer in the Server > Manager. > See the server log for details. > BUILD FAILED (total time: 57 seconds) > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > the tomcat error > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > 29/05/2007 14:39:23 org.apache.catalina.realm.DataSourceRealm open > SEVERE: Exception performing authentication > javax.naming.NameNotFoundException: Name jdbc is not bound in this Context > at org.apache.naming.NamingContext.lookup(NamingContext.java:769) > at org.apache.naming.NamingContext.lookup(NamingContext.java:152) > at > org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) > at > org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java: > 282) > at > org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe > nticator.java:180) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase > .java:490) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 > ) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 > ) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java > :107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC > onnection(Http11BaseProtocol.java:664) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav > a:527) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo > rkerThread.java:80) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav > a:684) > at java.lang.Thread.run(Thread.java:619) > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Re: Configuring a DataSourceRealm
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paulo, Paulo Vivacqua wrote: > Like I said before I am trying to setup a DataSourceRealm to > authenticate users by pull out the user information from a MySQL > database. You should remove the MemoryRealm from your configuration if you are going to use a DataSourceRealm. > 2 - I also configured a JNDI named jdbc/oaso on TomCat Server > Administration. I tested this connection through a DBCP and it´s > working fine. > > 3- I created a Realm inside the server.xml to use the JNDI jdbc/oaso > between the tags You have created a server-level data source. You need to remove localDataSource="true" from your configuration. That setting means "this is a data source defined in this "... and you haven't done that. Finally, you should throw /all/ that configuration out of server.xml and instead use /META-INF/context.xml just like all the Tomcat 5.x docs say. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGXHnS9CaO5/Lv0PARAv1SAKCScnUeBKkSvMF+UB2o331M24L0kwCgrDgj Oq1bc8SMdIaBxQe/NVVhJcA= =I9T3 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring a DataSourceRealm
Hi David, The "j_security_check is not a real page it´s a key for communicating with tomcat. I lookup all my code and there is no reference to JNDI jdbc. If I comment my Realm declaration on server.xml i get to the login page without any problem, and the authentication works, but the user info is retrieved from the tomcat-users file not from the database. I have my realm declaration placed right below the on my server.xml. Is it in the right place? can I have both? thanks again On 5/29/07, David Short <[EMAIL PROTECTED]> wrote: Somewhere in your code, probably in j_security_check, there is a reference to a datasource, which will reference the JNDI value. You need to change that reference from jdbc to jdbc/oaso. -Original Message- From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 10:46 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Configuring a DataSourceRealm Hi David, Thanks for the help. I don´t have a reference to JNDI jdbc on my code. What I have is a login page with a form that´s sent to tomcat for authentication. I restarted tomcat and what I am getting a login window for TomCat Manager Application. I tried using the a user and a password configured on tomcat-users but none of them work. the application error: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> do-dist: dist: F:\Paulo\ICESP\6sem\java\projetos\RealmJdbcTeste\nbproject\build-impl.xml:45 2: Deployment error: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager. See the server log for details. BUILD FAILED (total time: 57 seconds) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> the tomcat error >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 29/05/2007 14:39:23 org.apache.catalina.realm.DataSourceRealm open SEVERE: Exception performing authentication javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:769) at org.apache.naming.NamingContext.lookup(NamingContext.java:152) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java: 282) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe nticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC onnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) at java.lang.Thread.run(Thread.java:619) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 5/29/07, David Short <[EMAIL PROTECTED]> wrote: > In your code where you reference JNDI "jdbc", reference "jdbc/oaso" instead. > > > -Original Message- > From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 29, 2007 8:37 AM > To: Tomcat Users List > Subject: Re: Configuring a DataSourceRealm > > Hello chris, > > Thanks again for the help.I will try to be more clear so that maybe > you could help figure out what I am doing wrong. > > Like I said before I am trying to setup a DataSourceRealm to > authenti
RE: Configuring a DataSourceRealm
Somewhere in your code, probably in j_security_check, there is a reference to a datasource, which will reference the JNDI value. You need to change that reference from jdbc to jdbc/oaso. -Original Message- From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 10:46 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Configuring a DataSourceRealm Hi David, Thanks for the help. I don´t have a reference to JNDI jdbc on my code. What I have is a login page with a form that´s sent to tomcat for authentication. I restarted tomcat and what I am getting a login window for TomCat Manager Application. I tried using the a user and a password configured on tomcat-users but none of them work. the application error: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> do-dist: dist: F:\Paulo\ICESP\6sem\java\projetos\RealmJdbcTeste\nbproject\build-impl.xml:45 2: Deployment error: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager. See the server log for details. BUILD FAILED (total time: 57 seconds) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> the tomcat error >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 29/05/2007 14:39:23 org.apache.catalina.realm.DataSourceRealm open SEVERE: Exception performing authentication javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:769) at org.apache.naming.NamingContext.lookup(NamingContext.java:152) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java: 282) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe nticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC onnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) at java.lang.Thread.run(Thread.java:619) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 5/29/07, David Short <[EMAIL PROTECTED]> wrote: > In your code where you reference JNDI "jdbc", reference "jdbc/oaso" instead. > > > -Original Message- > From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 29, 2007 8:37 AM > To: Tomcat Users List > Subject: Re: Configuring a DataSourceRealm > > Hello chris, > > Thanks again for the help.I will try to be more clear so that maybe > you could help figure out what I am doing wrong. > > Like I said before I am trying to setup a DataSourceRealm to > authenticate users by pull out the user information from a MySQL database. > > 1- I already created the tables and columns in my database that > conforms to the requirements. > > 2 - I also configured a JNDI named jdbc/oaso on TomCat Server > Administration. I tested this connection through a DBCP and it´s > working fine. > > 3- I created a Realm inside the server.xml to use the JNDI jdbc/oaso > between the tags > > 4- I configured the on the web.xml > > When I run the project I
Re: Configuring a DataSourceRealm
Hi David, Thanks for the help. I don´t have a reference to JNDI jdbc on my code. What I have is a login page with a form that´s sent to tomcat for authentication. I restarted tomcat and what I am getting a login window for TomCat Manager Application. I tried using the a user and a password configured on tomcat-users but none of them work. the application error: do-dist: dist: F:\Paulo\ICESP\6sem\java\projetos\RealmJdbcTeste\nbproject\build-impl.xml:452: Deployment error: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager. See the server log for details. BUILD FAILED (total time: 57 seconds) the tomcat error 29/05/2007 14:39:23 org.apache.catalina.realm.DataSourceRealm open SEVERE: Exception performing authentication javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:769) at org.apache.naming.NamingContext.lookup(NamingContext.java:152) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:282) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619) On 5/29/07, David Short <[EMAIL PROTECTED]> wrote: In your code where you reference JNDI "jdbc", reference "jdbc/oaso" instead. -Original Message- From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 8:37 AM To: Tomcat Users List Subject: Re: Configuring a DataSourceRealm Hello chris, Thanks again for the help.I will try to be more clear so that maybe you could help figure out what I am doing wrong. Like I said before I am trying to setup a DataSourceRealm to authenticate users by pull out the user information from a MySQL database. 1- I already created the tables and columns in my database that conforms to the requirements. 2 - I also configured a JNDI named jdbc/oaso on TomCat Server Administration. I tested this connection through a DBCP and it´s working fine. 3- I created a Realm inside the server.xml to use the JNDI jdbc/oaso between the tags 4- I configured the on the web.xml When I run the project I get the following error: 29/05/2007 12:23:55 org.apache.catalina.realm.DataSourceRealm open SEVERE: Exception performing authentication javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:769) at org.apache.naming.NamingContext.lookup(NamingContext.java:152) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java: 282) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe nticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC onnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.
RE: Configuring a DataSourceRealm
In your code where you reference JNDI "jdbc", reference "jdbc/oaso" instead. -Original Message- From: Paulo Vivacqua [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 8:37 AM To: Tomcat Users List Subject: Re: Configuring a DataSourceRealm Hello chris, Thanks again for the help.I will try to be more clear so that maybe you could help figure out what I am doing wrong. Like I said before I am trying to setup a DataSourceRealm to authenticate users by pull out the user information from a MySQL database. 1- I already created the tables and columns in my database that conforms to the requirements. 2 - I also configured a JNDI named jdbc/oaso on TomCat Server Administration. I tested this connection through a DBCP and it´s working fine. 3- I created a Realm inside the server.xml to use the JNDI jdbc/oaso between the tags 4- I configured the on the web.xml When I run the project I get the following error: 29/05/2007 12:23:55 org.apache.catalina.realm.DataSourceRealm open SEVERE: Exception performing authentication javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:769) at org.apache.naming.NamingContext.lookup(NamingContext.java:152) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java: 282) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthe nticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC onnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) at java.lang.Thread.run(Thread.java:619) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> The server.xml >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> On 5/24/07, Christopher Schultz <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Paulo, > > Paulo Vivacqua wrote: > > I copied the Mysql Driver's jar into $CATALINA_HOME/common/lib. > > Ok. > > > I already created the database with the required tables user, > > user-roles and roles. > > Ok. > > > I configured JNDI DataSource in Tomcat by adding a declaration for > > my resource named jdbc/oaso into a Context path to > > $CATALINA_HOME/conf/server.xml. > > So you have a JNDI data source configured in server.xml? Does it need > to be global? If not, put it into your webapp in META-INF/context.xml > > > I configured the on the web.xml > > Ok. > > > I added the to the jdbc/oaso into the web.xml > > Good. If you configure your DataSource in context.xml, you don't need > this step, though I don't think it hurts. > > So... how doesn't it work? > > Do you get an exception? If so, give us the stack trace. > > Do you get a log message? If so, give us the message. > > You still haven't described what is wrong. For all I can tell, it's > working. > > - -chris > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.7 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGVeve9CaO5/Lv0PARArGuAJ90ugIycb6XnBc1UFDjDoaLs+WWygCfXRuW > qidBk4elye0qqFm4W4eDurw= > =7mX9 > -END PGP SIGNATURE- > > - > To start a
Re: Configuring a DataSourceRealm
Hello chris, Thanks again for the help.I will try to be more clear so that maybe you could help figure out what I am doing wrong. Like I said before I am trying to setup a DataSourceRealm to authenticate users by pull out the user information from a MySQL database. 1- I already created the tables and columns in my database that conforms to the requirements. 2 - I also configured a JNDI named jdbc/oaso on TomCat Server Administration. I tested this connection through a DBCP and it´s working fine. 3- I created a Realm inside the server.xml to use the JNDI jdbc/oaso between the tags 4- I configured the on the web.xml When I run the project I get the following error: 29/05/2007 12:23:55 org.apache.catalina.realm.DataSourceRealm open SEVERE: Exception performing authentication javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:769) at org.apache.naming.NamingContext.lookup(NamingContext.java:152) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:401) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:282) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619) The server.xml On 5/24/07, Christopher Schultz <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paulo, Paulo Vivacqua wrote: > I copied the Mysql Driver's jar into $CATALINA_HOME/common/lib. Ok. > I already created the database with the required tables user, > user-roles and roles. Ok. > I configured JNDI DataSource in Tomcat by adding a declaration for my > resource named jdbc/oaso into a Context path to > $CATALINA_HOME/conf/server.xml. So you have a JNDI data source configured in server.xml? Does it need to be global? If not, put it into your webapp in META-INF/context.xml > I configured the on the web.xml Ok. > I added the to the jdbc/oaso into the web.xml Good. If you configure your DataSource in context.xml, you don't need this step, though I don't think it hurts. So... how doesn't it work? Do you get an exception? If so, give us the stack trace. Do you get a log message? If so, give us the message. You still haven't described what is wrong. For all I can tell, it's working. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVeve9CaO5/Lv0PARArGuAJ90ugIycb6XnBc1UFDjDoaLs+WWygCfXRuW qidBk4elye0qqFm4W4eDurw= =7mX9 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Paulo Vivacqua [EMAIL PROTECTED] msn: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring a DataSourceRealm
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paulo, Paulo Vivacqua wrote: > I copied the Mysql Driver's jar into $CATALINA_HOME/common/lib. Ok. > I already created the database with the required tables user, > user-roles and roles. Ok. > I configured JNDI DataSource in Tomcat by adding a declaration for my > resource named jdbc/oaso into a Context path to > $CATALINA_HOME/conf/server.xml. So you have a JNDI data source configured in server.xml? Does it need to be global? If not, put it into your webapp in META-INF/context.xml > I configured the on the web.xml Ok. > I added the to the jdbc/oaso into the web.xml Good. If you configure your DataSource in context.xml, you don't need this step, though I don't think it hurts. So... how doesn't it work? Do you get an exception? If so, give us the stack trace. Do you get a log message? If so, give us the message. You still haven't described what is wrong. For all I can tell, it's working. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVeve9CaO5/Lv0PARArGuAJ90ugIycb6XnBc1UFDjDoaLs+WWygCfXRuW qidBk4elye0qqFm4W4eDurw= =7mX9 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring a DataSourceRealm
Hi Paulo. We'll need to know what version of Tomcat you are working with. --David Paulo Vivacqua wrote: Hello there, I am having difficulty implementing a Datasource realm for my application. I followed some tutorials but could not make it to work.I already posted this issue on other forums but I got no answer. The application Instead of pulling out data from the MySQL database it´s getting the user information from the tomcat-users.xml (MemoryRealm) web.xml http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> 30 index.jsp Constraint1 testeJdbc /index.jsp GET POST HEAD PUT OPTIONS TRACE DELETE admin admin tomcat member CONFIDENTIAL Constraint2 pagina1 /pagina1.jsp GET POST admin member CONFIDENTIAL FORM /Login.jsp /ErrorPage.jsp admin guest member tomcat JdbcRealmTeste jdbc/oaso javax.sql.DataSource Container server.xml className="org.apache.catalina.mbeans.ServerLifecycleListener"/> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/> value="30"/> maxWait 5000 maxActive 4 password shisqi3320 url jdbc:mysql://localhost:3306/renatovivacqua driverClassName com.mysql.jdbc.Driver maxIdle 2 username root factory org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf/tomcat-users.xml className="org.apache.catalina.logger.FileLogger" prefix="localhost_RealmJdbcTeste_log." suffix=".txt" timestamp="true"/> factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 4 maxIdle 2 maxWait 5000 username root password shisqi3320 driverClassName com.mysql.jdbc.Driver url jdbc:mysql://localhost:3306/renatovivacqua?autoReconnect=true className="org.apache.catalina.realm.UserDatabaseRealm"/> - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring a DataSourceRealm
Hello Chris, Thanks very much for your answer. Yes I am currently using MemoryRealm and I want to use DataSourceRealm instead. I am using tomcat 5.0 I copied the Mysql Driver's jar into $CATALINA_HOME/common/lib. I already created the database with the required tables user, user-roles and roles. I configured JNDI DataSource in Tomcat by adding a declaration for my resource named jdbc/oaso into a Context path to $CATALINA_HOME/conf/server.xml. I configured the on the web.xml I added the to the jdbc/oaso into the web.xml On 5/24/07, Christopher Schultz <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paulo, Paulo Vivacqua wrote: > I am having difficulty implementing a Datasource realm for my > application. I followed some tutorials but could not make it to work.I > already posted this issue on other forums but I got no answer. > > The application Instead of pulling out data from the MySQL database > it´s getting the user information from the tomcat-users.xml > (MemoryRealm) So... you are currently using MemoryRealm and you want to use DataSourceRealm instead? What version of Tomcat are you using? What have you tried already? Posting configuration without telling us what else you know isn't very helpful :( - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVarm9CaO5/Lv0PARApCKAJ9T31kPWmqWi7Qqj+dKQCFZp44CegCfTOdL EQKleoWdZtWgU7j8lDzycPg= =G1yI -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Paulo Vivacqua [EMAIL PROTECTED] msn: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring a DataSourceRealm
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paulo, Paulo Vivacqua wrote: > I am having difficulty implementing a Datasource realm for my > application. I followed some tutorials but could not make it to work.I > already posted this issue on other forums but I got no answer. > > The application Instead of pulling out data from the MySQL database > it´s getting the user information from the tomcat-users.xml > (MemoryRealm) So... you are currently using MemoryRealm and you want to use DataSourceRealm instead? What version of Tomcat are you using? What have you tried already? Posting configuration without telling us what else you know isn't very helpful :( - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVarm9CaO5/Lv0PARApCKAJ9T31kPWmqWi7Qqj+dKQCFZp44CegCfTOdL EQKleoWdZtWgU7j8lDzycPg= =G1yI -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Configuring a DataSourceRealm
Hello there, I am having difficulty implementing a Datasource realm for my application. I followed some tutorials but could not make it to work.I already posted this issue on other forums but I got no answer. The application Instead of pulling out data from the MySQL database it´s getting the user information from the tomcat-users.xml (MemoryRealm) web.xml http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> 30 index.jsp Constraint1 testeJdbc /index.jsp GET POST HEAD PUT OPTIONS TRACE DELETE admin admin tomcat member CONFIDENTIAL Constraint2 pagina1 /pagina1.jsp GET POST admin member CONFIDENTIAL FORM /Login.jsp /ErrorPage.jsp admin guest member tomcat JdbcRealmTeste jdbc/oaso javax.sql.DataSource Container server.xml maxWait 5000 maxActive 4 password shisqi3320 url jdbc:mysql://localhost:3306/renatovivacqua driverClassName com.mysql.jdbc.Driver maxIdle 2 username root factory org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf/tomcat-users.xml factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 4 maxIdle 2 maxWait 5000 username root password shisqi3320 driverClassName com.mysql.jdbc.Driver url jdbc:mysql://localhost:3306/renatovivacqua?autoReconnect=true - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]