RE: JNDI DataSource Realm
Where is your JDBC driver .jar file located? It should be in /common/lib. Also, how are you instantiating your DataSource object within your code? Thanks, Scott Stewart [Manager, Software Development] [EMAIL PROTECTED] ClearSky Mobile Media, Inc. 56 E. Pine St. Suite 200 Orlando, FL 32801 USA -Original Message- From: Madere, Colin [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 3:44 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource Realm Ok, so changing the "dataSourceName" attribute in the Realm config (as you suggest which contradicts the HOWTO) to the short name I've given my resource makes the Realm auth work with the globally defined datasource. Yay! However, when trying to connect to the datasource (moved the "jdbc/Auth" resource from tag to tag), my servlet application still gives the same "Name jdbc is not bound in this Context" error. You mention not having to put a in the context specific web.xml file, and I assume your suggestion to put tag in the Context (in my case putting it in the tag so it works, or should, for all autodeployed contexts) is what you mean removes the need for the those aforementioned entries. However, it doesn't appear to work (as it _does_ work when I move the whole / tags into the tag. Don't want to do this as I will have multiple virtual hosts using the same resource...) Doubt it's of importance, but adding the you suggest is not necessary produces the elusive "Cannot load JDBC driver class 'null'" error, which I believe is unrelated. Any more ideas why my app would not see the global resource as defined below as a global resource and then resource-linked in the default context? -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:27 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource Realm I posted this awhile back (for MySQL), but here it is again. Also, when you define your DataSource in this manner, you do not need the node in your context-specific web.xml files. The global DataSource definition username password driverClassName com.mysql.jdbc.Driver url jdbc:mysql://:3306/?autoReconnect=true removeAbandoned true removeAbandonedTimeout 60 logAbandoned true maxActive 200 maxIdle 3 maxWait 100 Realm definition using global DataSource Context reference to global DataSource -- Hope this helps!! Thanks, Scott Stewart [Manager, Software Development] [EMAIL PROTECTED] ClearSky Mobile Media, Inc. 56 E. Pine St. Suite 200 Orlando, FL 32801 USA -Original Message- From: Madere, Colin [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:17 PM To: 'Tomcat Users List' Subject: JNDI DataSource Realm Tomcat 4.1.27 PostgreSQL 7.3.4 pg73jdbc3.jar Trying to use JNDI as a Realm source for both auth and data access for a whole server, therefore trying as a GlobalNamingContext attribute. No love. * Set up as a JDBC Realm, auth works. * Set up Datasource as JNDI Resource within , data access works. Move and params to and I get the "Name jdbc is not bound in this Context" error. Saw lots of refs to this error via Google, but none relevant AFAICT. (Do I look up resources in the global context differently? If so doesn't that kind of break the idea of it being an abstractly defined data source?) Anyone successfully using for DataSources? Using these components (Tomcat 4.1.x, postgreSQL)? Change Realm from JDBC to Dat
RE: JNDI DataSource Realm
Ok, so changing the "dataSourceName" attribute in the Realm config (as you suggest which contradicts the HOWTO) to the short name I've given my resource makes the Realm auth work with the globally defined datasource. Yay! However, when trying to connect to the datasource (moved the "jdbc/Auth" resource from tag to tag), my servlet application still gives the same "Name jdbc is not bound in this Context" error. You mention not having to put a in the context specific web.xml file, and I assume your suggestion to put tag in the Context (in my case putting it in the tag so it works, or should, for all autodeployed contexts) is what you mean removes the need for the those aforementioned entries. However, it doesn't appear to work (as it _does_ work when I move the whole / tags into the tag. Don't want to do this as I will have multiple virtual hosts using the same resource...) Doubt it's of importance, but adding the you suggest is not necessary produces the elusive "Cannot load JDBC driver class 'null'" error, which I believe is unrelated. Any more ideas why my app would not see the global resource as defined below as a global resource and then resource-linked in the default context? -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:27 PM To: 'Tomcat Users List' Subject: RE: JNDI DataSource Realm I posted this awhile back (for MySQL), but here it is again. Also, when you define your DataSource in this manner, you do not need the node in your context-specific web.xml files. The global DataSource definition username password driverClassName com.mysql.jdbc.Driver url jdbc:mysql://:3306/?autoReconnect=true removeAbandoned true removeAbandonedTimeout 60 logAbandoned true maxActive 200 maxIdle 3 maxWait 100 Realm definition using global DataSource Context reference to global DataSource -- Hope this helps!! Thanks, Scott Stewart [Manager, Software Development] [EMAIL PROTECTED] ClearSky Mobile Media, Inc. 56 E. Pine St. Suite 200 Orlando, FL 32801 USA -Original Message- From: Madere, Colin [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:17 PM To: 'Tomcat Users List' Subject: JNDI DataSource Realm Tomcat 4.1.27 PostgreSQL 7.3.4 pg73jdbc3.jar Trying to use JNDI as a Realm source for both auth and data access for a whole server, therefore trying as a GlobalNamingContext attribute. No love. * Set up as a JDBC Realm, auth works. * Set up Datasource as JNDI Resource within , data access works. Move and params to and I get the "Name jdbc is not bound in this Context" error. Saw lots of refs to this error via Google, but none relevant AFAICT. (Do I look up resources in the global context differently? If so doesn't that kind of break the idea of it being an abstractly defined data source?) Anyone successfully using for DataSources? Using these components (Tomcat 4.1.x, postgreSQL)? Change Realm from JDBC to DataSourceRealm and auth does not work (or report any errors in logs). server.xml (with DataSourceRealm commented out) factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1
RE: JNDI DataSource Realm
I posted this awhile back (for MySQL), but here it is again. Also, when you define your DataSource in this manner, you do not need the node in your context-specific web.xml files. The global DataSource definition username password driverClassName com.mysql.jdbc.Driver url jdbc:mysql://:3306/?autoReconnect=true removeAbandoned true removeAbandonedTimeout 60 logAbandoned true maxActive 200 maxIdle 3 maxWait 100 Realm definition using global DataSource Context reference to global DataSource -- Hope this helps!! Thanks, Scott Stewart [Manager, Software Development] [EMAIL PROTECTED] ClearSky Mobile Media, Inc. 56 E. Pine St. Suite 200 Orlando, FL 32801 USA -Original Message- From: Madere, Colin [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:17 PM To: 'Tomcat Users List' Subject: JNDI DataSource Realm Tomcat 4.1.27 PostgreSQL 7.3.4 pg73jdbc3.jar Trying to use JNDI as a Realm source for both auth and data access for a whole server, therefore trying as a GlobalNamingContext attribute. No love. * Set up as a JDBC Realm, auth works. * Set up Datasource as JNDI Resource within , data access works. Move and params to and I get the "Name jdbc is not bound in this Context" error. Saw lots of refs to this error via Google, but none relevant AFAICT. (Do I look up resources in the global context differently? If so doesn't that kind of break the idea of it being an abstractly defined data source?) Anyone successfully using for DataSources? Using these components (Tomcat 4.1.x, postgreSQL)? Change Realm from JDBC to DataSourceRealm and auth does not work (or report any errors in logs). server.xml (with DataSourceRealm commented out) factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1 username www password driverClassName org.postgresql.Driver url jdbc:postgresql://localhost/www_auth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]