RE: Database connection pooling
looks like you are using the 5.0 docs rather than 5.5 http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html Context ... ... Resource name=jdbc/EmployeeDB auth=Container type=javax.sql.DataSource username=dbusername password=dbpassword driverClassName=org.hsql.jdbcDriver url=jdbc:HypersonicSQL:database maxActive=8 maxIdle=4/ ... /Context Allistair -Original Message- From: Nat Titman [mailto:[EMAIL PROTECTED] Sent: 27 October 2004 12:22 To: [EMAIL PROTECTED] Subject: Database connection pooling Hi, I'm attempting to integrate database connection pooling into an exisiting JSP-based web application. I'm running Tomcat 5.5.2 Server, with J2SE 1.5.0 and a MySQL database (version 11.18) accessed through the com.mysql.jdbc package. I've followed MySQL instructions from this page: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasourc e-examples-howto.html I made the changes to server.xml and the web app's web.xml, changing variables to match the database name, user name and password of the correct database. I ensured the MySQL package was in common/lib/. My DAO objects now have constructors of the following form, which was adapted from code found online ('broadband' is the database name): private Connection myConn; private DataSource dataSource; /** * Constructs the data accessor using the connection pool * * @exception SQLException thrown for SQL errors */ public SearchDAO() throws SQLException { try { // retrieve datasource Context init = new InitialContext(); Context ctx = (Context) init.lookup(java:comp/env); dataSource = (DataSource) ctx.lookup(jdbc/broadband); // get connection synchronized (dataSource) { myConn = dataSource.getConnection(); } } catch (NamingException ex) { System.err.println( new SearchDAO: Cannot retrieve java:comp/env/jdbc/broadband: + ex); } catch (SQLException excep) { System.err.println( new SearchDAO: Could not get connection: + excep); } catch (Exception e) { System.err.println(new SearchDAO: + e); // System.out.println (In the catch block : ); //e.printStackTrace(); } } The constructor throws the following exception: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' The connect URL is present in server.xml and is correct for the database. My only guess at this point is that the howto document above asks for the Context tag to be added to server.xml between the example close Context and the first open Host tag, however there wasn't an example Context tag in server.xml and there appears to be a context.xml file in the same directory. I'm wondering if Contexts have moved to a different file in a recent version of Tomcat? It's just a wild guess (and I've no idea how to add the Context to context.xml as there's already a Context tag in there and no higher level tag around it). Any help would be greatly appreciated. Sorry if I'm wasting your time with an obvious or frequently asked question, I've googled and read quite a few documents, but I think I'm just at the 'stabbing in the dark' point and could do with guru guidance. Thanks, Nat. -- Nat Titman Developer MitchellConnerSearson 3-5 High Pavement The Lace Market Nottingham NG1 1HF Tel +44 (0)115 959 6455 Fax +44 (0)115 959 6456 Direct +44 (0)115 959 6462 www.choosemcs.co.uk Confidentiality: This e-mail and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e-mail and highlight the error. Security Warning: Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and observe this lack of security when e-mailing us. Viruses: Although we have taken steps to ensure that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT
RE: Database connection pooling
see my post from yesterday RE: JNDI DataSource GlobalResources problem :) This exception means that TC cannot find your Resource. Your only guess is correct! Put your Context in either webapps/yourwebapp/META_INF/context.xml (if you are deploying in a war) or conf/Catalina/localhost/yourwebapp.xml (if you are deploying unpacked) or for v5.5 maybe that should be conf/context.xml (if you are deploying unpacked) I think it'll then work as long as your ResourceParams are all correct. It's OK for Context to be the top level tag in the file. If the context tag already in context.xml is for your webapp, then just add the ResourceParams tag inside that Context. You can add Resource too but it's not required as long as you have a matching resource-ref in your web.xml file. If the existing Context is for a different webapp, I think I'm right in saying that you can add another whole Context to the same file. Alternatively I think I'm right in saying that you can add your Context tag inside the default Host tag in server.xml corresponding to the default localhost. You're right there is no examples context tag there - this is a correction that I plan to submit to the howto. Having said that, as of v5.5, placing Contexts inside server.xml is not recommended. -Original Message- From: Nat Titman [mailto:[EMAIL PROTECTED] Sent: Wednesday 27 October 2004 12:22 To: [EMAIL PROTECTED] Subject: Database connection pooling Hi, I'm attempting to integrate database connection pooling into an exisiting JSP-based web application. I'm running Tomcat 5.5.2 Server, with J2SE 1.5.0 and a MySQL database (version 11.18) accessed through the com.mysql.jdbc package. I've followed MySQL instructions from this page: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasourc e-examples-howto.html I made the changes to server.xml and the web app's web.xml, changing variables to match the database name, user name and password of the correct database. I ensured the MySQL package was in common/lib/. My DAO objects now have constructors of the following form, which was adapted from code found online ('broadband' is the database name): private Connection myConn; private DataSource dataSource; /** * Constructs the data accessor using the connection pool * * @exception SQLException thrown for SQL errors */ public SearchDAO() throws SQLException { try { // retrieve datasource Context init = new InitialContext(); Context ctx = (Context) init.lookup(java:comp/env); dataSource = (DataSource) ctx.lookup(jdbc/broadband); // get connection synchronized (dataSource) { myConn = dataSource.getConnection(); } } catch (NamingException ex) { System.err.println( new SearchDAO: Cannot retrieve java:comp/env/jdbc/broadband: + ex); } catch (SQLException excep) { System.err.println( new SearchDAO: Could not get connection: + excep); } catch (Exception e) { System.err.println(new SearchDAO: + e); // System.out.println (In the catch block : ); //e.printStackTrace(); } } The constructor throws the following exception: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' The connect URL is present in server.xml and is correct for the database. My only guess at this point is that the howto document above asks for the Context tag to be added to server.xml between the example close Context and the first open Host tag, however there wasn't an example Context tag in server.xml and there appears to be a context.xml file in the same directory. I'm wondering if Contexts have moved to a different file in a recent version of Tomcat? It's just a wild guess (and I've no idea how to add the Context to context.xml as there's already a Context tag in there and no higher level tag around it). Any help would be greatly appreciated. Sorry if I'm wasting your time with an obvious or frequently asked question, I've googled and read quite a few documents, but I think I'm just at the 'stabbing in the dark' point and could do with guru guidance. Thanks, Nat. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection pooling
small correction: putting Context inside server.xml is not recommended since v5.0, not 5.5 -Original Message- From: Steve Kirk [mailto:[EMAIL PROTECTED] Sent: Wednesday 27 October 2004 13:14 To: 'Tomcat Users List' Subject: RE: Database connection pooling see my post from yesterday RE: JNDI DataSource GlobalResources problem :) This exception means that TC cannot find your Resource. Your only guess is correct! Put your Context in either webapps/yourwebapp/META_INF/context.xml (if you are deploying in a war) or conf/Catalina/localhost/yourwebapp.xml (if you are deploying unpacked) or for v5.5 maybe that should be conf/context.xml (if you are deploying unpacked) I think it'll then work as long as your ResourceParams are all correct. It's OK for Context to be the top level tag in the file. If the context tag already in context.xml is for your webapp, then just add the ResourceParams tag inside that Context. You can add Resource too but it's not required as long as you have a matching resource-ref in your web.xml file. If the existing Context is for a different webapp, I think I'm right in saying that you can add another whole Context to the same file. Alternatively I think I'm right in saying that you can add your Context tag inside the default Host tag in server.xml corresponding to the default localhost. You're right there is no examples context tag there - this is a correction that I plan to submit to the howto. Having said that, as of v5.5, placing Contexts inside server.xml is not recommended. -Original Message- From: Nat Titman [mailto:[EMAIL PROTECTED] Sent: Wednesday 27 October 2004 12:22 To: [EMAIL PROTECTED] Subject: Database connection pooling Hi, I'm attempting to integrate database connection pooling into an exisiting JSP-based web application. I'm running Tomcat 5.5.2 Server, with J2SE 1.5.0 and a MySQL database (version 11.18) accessed through the com.mysql.jdbc package. I've followed MySQL instructions from this page: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasourc e-examples-howto.html I made the changes to server.xml and the web app's web.xml, changing variables to match the database name, user name and password of the correct database. I ensured the MySQL package was in common/lib/. My DAO objects now have constructors of the following form, which was adapted from code found online ('broadband' is the database name): private Connection myConn; private DataSource dataSource; /** * Constructs the data accessor using the connection pool * * @exception SQLException thrown for SQL errors */ public SearchDAO() throws SQLException { try { // retrieve datasource Context init = new InitialContext(); Context ctx = (Context) init.lookup(java:comp/env); dataSource = (DataSource) ctx.lookup(jdbc/broadband); // get connection synchronized (dataSource) { myConn = dataSource.getConnection(); } } catch (NamingException ex) { System.err.println( new SearchDAO: Cannot retrieve java:comp/env/jdbc/broadband: + ex); } catch (SQLException excep) { System.err.println( new SearchDAO: Could not get connection: + excep); } catch (Exception e) { System.err.println(new SearchDAO: + e); // System.out.println (In the catch block : ); //e.printStackTrace(); } } The constructor throws the following exception: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' The connect URL is present in server.xml and is correct for the database. My only guess at this point is that the howto document above asks for the Context tag to be added to server.xml between the example close Context and the first open Host tag, however there wasn't an example Context tag in server.xml and there appears to be a context.xml file in the same directory. I'm wondering if Contexts have moved to a different file in a recent version of Tomcat? It's just a wild guess (and I've no idea how to add the Context to context.xml as there's already a Context tag in there and no higher level tag around it). Any help would be greatly appreciated. Sorry if I'm wasting your time with an obvious or frequently asked question, I've googled and read quite a few documents, but I think I'm just at the 'stabbing in the dark' point and could do with guru guidance. Thanks, Nat. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
Re: Database connection
HI Thanks a lot. I am sending the server.xml and web.xml files below. Server.xml ?xml version=1.0 encoding=utf-8 ? - Server Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / - GlobalNamingResources Environment description= name=maxExcemptions override=false type=java.lang.Integer value=10 / Environment name=simpleValue type=java.lang.Integer value=30 / Resource auth=Container description=User database that can be updated and saved name=UserDatabase type=org.apache.catalina.UserDatabase / Resource description= name=EIRPDB1 type=org.apache.catalina.UserDatabase / Resource name=jdbc/db2 type=javax.sql.DataSource / - ResourceParams name=UserDatabase - parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter - parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams - ResourceParams name=EIRPDB1 - parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter - parameter namepathname/name valueD:\DB2\NODE\/value /parameter /ResourceParams - ResourceParams name=jdbc/db2 - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter - parameter namemaxWait/name value5000/value /parameter - parameter namemaxActive/name value10/value /parameter - parameter namepassword/name valuedb2admin/value /parameter - parameter nameurl/name valuejdbc:db2:EIRPDB1/value /parameter - parameter namedriverClassName/name valueCOM.ibm.db2.jdbc.app.DB2Driver/value /parameter - parameter namemaxIdle/name value2/value /parameter - parameter nameusername/name valuedb2admin/value /parameter /ResourceParams /GlobalNamingResources - Service name=Catalina Connector acceptCount=100 connectionTimeout=2 disableUploadTimeout=true port=8080 redirectPort=8443 maxSpareThreads=75 maxThreads=150 minSpareThreads=25 / Connector port=8009 protocol=AJP/1.3 protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler redirectPort=8443 / - Engine defaultHost=localhost name=Catalina - Host appBase=webapps name=localhost Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_log. suffix=.txt timestamp=true / /Host Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true / Realm className=org.apache.catalina.realm.UserDatabaseRealm / /Engine /Service /Server web.xml: ?xml version=1.0 encoding=ISO-8859-1 ? + !-- Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- - web-app xmlns=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; version=2.4 display-nameWelcome to Tomcat/display-name descriptionWelcome to Tomcat/description - !-- JSPC servlet mappings start -- - servlet servlet-nameorg.apache.jsp.index_jsp/servlet-name servlet-classorg.apache.jsp.index_jsp/servlet-class /servlet - servlet-mapping servlet-nameorg.apache.jsp.index_jsp/servlet-name url-pattern/index.jsp/url-pattern /servlet-mapping - !-- JSPC servlet mappings end -- - resource-ref descriptionDB2 Datasource example/description res-ref-namejdbc/db2/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref - resource-env-ref descriptionObject factory for MyBean instances./description resource-env-ref-namebean/MyBeanFactory/resource-env-ref-name resource-env-ref-typecom.iipl.eirp.dbconnection.test/resource-env-ref-typ e /resource-env-ref /web-app You have take so much of trouble to help. Thanks a lot once again. Regards Bhaskar - Original Message - From: Pradeep Chauhan [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, August 06, 2004 3:58 PM Subject: RE: [SPAM_EMAIL] - Database connection - Found word(s) list error in the Text body. Ok then do one thing post your web.xml and server.xml -Original Message- From: Bhaskar Jyoti Phukan [mailto:[EMAIL PROTECTED] Sent: 06.08.2004 15:13 To: Tomcat Users List Subject: [SPAM_EMAIL] - Database connection - Found word(s) list error in the Text body. Hi! Thanks a lot for the reply. We have tried all this and also followed the tomcat
RE: [SPAM_EMAIL] - Re: Database connection - Found word(s) list error in the Text body.
Hi , In GlobalResource you have declared 2 resource 1. EIRPDB1 2. jdbc/db2 In defination section you deifne EIRPDB1 and jdbc/db2 In web.xml you refer 'jdbc/db2' i guess you are using jdbc/db2 to connect to DB2 but you forget to copy paste the Context of you application where you have declare application is using which resource. I need that also to tell you the excat issue. Regards, Pradeep -Original Message- From: Bhaskar Jyoti Phukan [mailto:[EMAIL PROTECTED] Sent: 06.08.2004 16:49 To: Tomcat Users List Subject: [SPAM_EMAIL] - Re: Database connection - Found word(s) list error in the Text body. HI Thanks a lot. I am sending the server.xml and web.xml files below. Server.xml ?xml version=1.0 encoding=utf-8 ? - Server Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / - GlobalNamingResources Environment description= name=maxExcemptions override=false type=java.lang.Integer value=10 / Environment name=simpleValue type=java.lang.Integer value=30 / Resource auth=Container description=User database that can be updated and saved name=UserDatabase type=org.apache.catalina.UserDatabase / Resource description= name=EIRPDB1 type=org.apache.catalina.UserDatabase / Resource name=jdbc/db2 type=javax.sql.DataSource / - ResourceParams name=UserDatabase - parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter - parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams - ResourceParams name=EIRPDB1 - parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter - parameter namepathname/name valueD:\DB2\NODE\/value /parameter /ResourceParams - ResourceParams name=jdbc/db2 - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter - parameter namemaxWait/name value5000/value /parameter - parameter namemaxActive/name value10/value /parameter - parameter namepassword/name valuedb2admin/value /parameter - parameter nameurl/name valuejdbc:db2:EIRPDB1/value /parameter - parameter namedriverClassName/name valueCOM.ibm.db2.jdbc.app.DB2Driver/value /parameter - parameter namemaxIdle/name value2/value /parameter - parameter nameusername/name valuedb2admin/value /parameter /ResourceParams /GlobalNamingResources - Service name=Catalina Connector acceptCount=100 connectionTimeout=2 disableUploadTimeout=true port=8080 redirectPort=8443 maxSpareThreads=75 maxThreads=150 minSpareThreads=25 / Connector port=8009 protocol=AJP/1.3 protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler redirectPort=8443 / - Engine defaultHost=localhost name=Catalina - Host appBase=webapps name=localhost Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_log. suffix=.txt timestamp=true / /Host Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true / Realm className=org.apache.catalina.realm.UserDatabaseRealm / /Engine /Service /Server web.xml: ?xml version=1.0 encoding=ISO-8859-1 ? + !-- Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- - web-app xmlns=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; version=2.4 display-nameWelcome to Tomcat/display-name descriptionWelcome to Tomcat/description - !-- JSPC servlet mappings start -- - servlet servlet-nameorg.apache.jsp.index_jsp/servlet-name servlet-classorg.apache.jsp.index_jsp/servlet-class /servlet - servlet-mapping servlet-nameorg.apache.jsp.index_jsp/servlet-name url-pattern/index.jsp/url-pattern /servlet-mapping - !-- JSPC servlet mappings end -- - resource-ref descriptionDB2 Datasource example/description res-ref-namejdbc/db2/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref - resource-env-ref descriptionObject factory for MyBean instances./description resource-env-ref-namebean/MyBeanFactory/resource-env-ref-name resource-env-ref-typecom.iipl.eirp.dbconnection.test/resource-env-ref-typ e /resource-env-ref /web-app You have take so much of trouble to help. Thanks a lot once
RE: Database connection problems after redeploying war
Please can you help me. I do I stop receiving emails from this community? It's filling up my mail box rapidly Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 9:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt timestamp=true/ Resource name=jdbc/myPool auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myPool parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameusername/name value.../value /parameter parameter namepassword/name value.../value /parameter parameter namedriverClassName/name valuecom.inet.tds.TdsDriver/value /parameter parameter nameurl/name value.../value /parameter /ResourceParams /Context - 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]
RE: Database connection problems after redeploying war
Go to this URL: http://jakarta.apache.org/site/mail2.html#Tomcat and click the Unsubscribe link and follow the instructions. Peace Tom Arikawe, Akindele (DeleArikawe) To [EMAIL PROTECTED] Tomcat Users List rontexaco.com[EMAIL PROTECTED] cc 06/14/2004 01:06 AMSubject RE: Database connection problems after redeploying war Please respond to Tomcat Users List [EMAIL PROTECTED] rta.apache.org Please can you help me. I do I stop receiving emails from this community? It's filling up my mail box rapidly Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 9:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt timestamp=true/ Resource name=jdbc/myPool auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myPool parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameusername/name value.../value /parameter parameter namepassword/name value.../value /parameter parameter namedriverClassName/name valuecom.inet.tds.TdsDriver/value /parameter parameter nameurl/name value.../value /parameter /ResourceParams
RE: Database connection problems after redeploying war
OK, finally figured it out. I moved the Resource elements that contained the connection pools into the GlobalNamingResources element in server.xml. I then created the context.xml file that contained ResourceLink elements that pointed to the ones defined in the global section mentioned before. I had tried this before with no luck, but I figured out why this didn't work before. When deploying the war via the manager app, I was specifying the path parameter in the URL. I guess in doing this the context.xml file was ignored during deployment. I can now redeploy the war without having to restart Tomcat. -Original Message- From: Chad Boyd Sent: Friday, June 11, 2004 10:01 PM To: Tomcat Users List Subject: RE: Database connection problems after redeploying war How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please
RE: Database connection problems after redeploying war
Sweet! Thanks for the info! Peace Tom Chad Boyd [EMAIL PROTECTED] .net To Tomcat Users List 06/12/2004 12:14 [EMAIL PROTECTED] PM cc Subject Please respond to RE: Database connection problems Tomcat Users after redeploying war List [EMAIL PROTECTED] rta.apache.org OK, finally figured it out. I moved the Resource elements that contained the connection pools into the GlobalNamingResources element in server.xml. I then created the context.xml file that contained ResourceLink elements that pointed to the ones defined in the global section mentioned before. I had tried this before with no luck, but I figured out why this didn't work before. When deploying the war via the manager app, I was specifying the path parameter in the URL. I guess in doing this the context.xml file was ignored during deployment. I can now redeploy the war without having to restart Tomcat. -Original Message- From: Chad Boyd Sent: Friday, June 11, 2004 10:01 PM To: Tomcat Users List Subject: RE: Database connection problems after redeploying war How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database
RE: Database connection problems after redeploying war
Just a side note. I couldn't get this to work in Tomcat 5.0.19. I had to upgrade to 5.0.25. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, June 12, 2004 2:27 PM To: [EMAIL PROTECTED] Subject: RE: Database connection problems after redeploying war Sweet! Thanks for the info! Peace Tom Chad Boyd [EMAIL PROTECTED] .net To Tomcat Users List 06/12/2004 12:14 [EMAIL PROTECTED] PM cc Subject Please respond to RE: Database connection problems Tomcat Users after redeploying war List [EMAIL PROTECTED] rta.apache.org OK, finally figured it out. I moved the Resource elements that contained the connection pools into the GlobalNamingResources element in server.xml. I then created the context.xml file that contained ResourceLink elements that pointed to the ones defined in the global section mentioned before. I had tried this before with no luck, but I figured out why this didn't work before. When deploying the war via the manager app, I was specifying the path parameter in the URL. I guess in doing this the context.xml file was ignored during deployment. I can now redeploy the war without having to restart Tomcat. -Original Message- From: Chad Boyd Sent: Friday, June 11, 2004 10:01 PM To: Tomcat Users List Subject: RE: Database connection problems after redeploying war How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we
Re: Database connection problems after redeploying war
We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt timestamp=true/ Resource name=jdbc/myPool auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myPool parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameusername/name value.../value /parameter parameter namepassword/name value.../value /parameter parameter namedriverClassName/name valuecom.inet.tds.TdsDriver/value /parameter parameter nameurl/name value.../value /parameter /ResourceParams /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection problems after redeploying war
I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt timestamp=true/ Resource name=jdbc/myPool auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myPool parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameusername/name value.../value /parameter parameter namepassword/name value.../value /parameter parameter namedriverClassName/name
RE: Database connection problems after redeploying war
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt timestamp=true/ Resource name=jdbc/myPool auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myPool parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameusername/name value.../value /parameter parameter namepassword/name value.../value /parameter parameter namedriverClassName/name valuecom.inet.tds.TdsDriver/value /parameter parameter nameurl/name value.../value /parameter /ResourceParams /Context - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection problems after redeploying war
Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt timestamp=true/ Resource name=jdbc/myPool auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myPool parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameusername/name value.../value /parameter
RE: Database connection problems after redeploying war
Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt
RE: Database connection problems after redeploying war
How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom Chad Boyd [EMAIL PROTECTED] .net To [EMAIL PROTECTED] 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war Tomcat Users List [EMAIL PROTECTED] rta.apache.org I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous Cannot create JDBC driver of class '' for connect URL 'null' error message. When I put the context element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time
RE: Database connection going from servlet to a bean
There is a jspInit() method in a JSP that you can 'override' by doing: %! public void jspInit() { } % So the answer for 'how' is; the same way -Original Message- From: Tom K [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 12:58 PM To: [EMAIL PROTECTED] Subject: Database connection going from servlet to a bean I am going from a html--servlet--output to a jsp--javabean--jsp configuration. In my servlet I connect via JNDI like this: public void init(ServletConfig config) throws ServletException{ super.init(config); try{ Context env = (Context) new InitialContext().lookup(java:comp/env); pool = (DataSource) env.lookup(jdbc/app1); if (pool == null) throw new ServletException(`jdbc/app1' is an unknown DataSource); }catch (NamingException e) { throw new ServletException(e); } How would I connect using a JSP? Or would this be done in the javabean? TIA Tom K. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection going from servlet to a bean
Mike thanks for the feedback, but is this the practical solution? For example, I am using a connection pool, the init is only done once, the bean does the processing, after the processing it done (that is the beans set their properties) the results are forwarded to another jsp for viewing, so where do I release my connection back into the pool? TIA Tom K. -Original Message- From: Mike Curwen [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 1:31 PM To: 'Tomcat Users List' Subject: RE: Database connection going from servlet to a bean There is a jspInit() method in a JSP that you can 'override' by doing: %! public void jspInit() { } % So the answer for 'how' is; the same way -Original Message- From: Tom K [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 12:58 PM To: [EMAIL PROTECTED] Subject: Database connection going from servlet to a bean I am going from a html--servlet--output to a jsp--javabean--jsp configuration. In my servlet I connect via JNDI like this: public void init(ServletConfig config) throws ServletException{ super.init(config); try{ Context env = (Context) new InitialContext().lookup(java:comp/env); pool = (DataSource) env.lookup(jdbc/app1); if (pool == null) throw new ServletException(`jdbc/app1' is an unknown DataSource); }catch (NamingException e) { throw new ServletException(e); } How would I connect using a JSP? Or would this be done in the javabean? TIA Tom K. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection going from servlet to a bean
Hi, Mike thanks for the feedback, but is this the practical solution? For example, I am using a connection pool, the init is only done once, the bean does the processing, after the processing it done (that is the beans set their properties) the results are forwarded to another jsp for viewing, so where do I release my connection back into the pool? Your question is a good argument for having the bean retrieve the connection, do its processing, and release the connection. The results you're forwarding can't be a java.sql.ResultSet, as that keeps the connection open, but some other object containing the processed results. Hand-in-hand with this approach goes the practice of getting a handle to your connection pool in a ServletContextListener. The listener can make a getConnectionPool() or getConnection() method available for use by your beans. This approach has several advantages over the servlet init (or jspInit for a JSP) design, all of which have been discussed in the past on this list so if you're interested you can search the archives. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection going from servlet to a bean
I think any object that has a connection can 'release' it back to the pool, simply by calling connection.close(). And no, the method I outlined isn't practical or a best practice, but if you were insistent on doing stuff in a JSP, that's how I'd do it (and have done it *meep*) ;) -Original Message- From: Tom K [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 1:40 PM To: 'Tomcat Users List' Subject: RE: Database connection going from servlet to a bean Mike thanks for the feedback, but is this the practical solution? For example, I am using a connection pool, the init is only done once, the bean does the processing, after the processing it done (that is the beans set their properties) the results are forwarded to another jsp for viewing, so where do I release my connection back into the pool? TIA Tom K. -Original Message- From: Mike Curwen [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 1:31 PM To: 'Tomcat Users List' Subject: RE: Database connection going from servlet to a bean There is a jspInit() method in a JSP that you can 'override' by doing: %! public void jspInit() { } % So the answer for 'how' is; the same way -Original Message- From: Tom K [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 12:58 PM To: [EMAIL PROTECTED] Subject: Database connection going from servlet to a bean I am going from a html--servlet--output to a jsp--javabean--jsp configuration. In my servlet I connect via JNDI like this: public void init(ServletConfig config) throws ServletException{ super.init(config); try{ Context env = (Context) new InitialContext().lookup(java:comp/env); pool = (DataSource) env.lookup(jdbc/app1); if (pool == null) throw new ServletException(`jdbc/app1' is an unknown DataSource); }catch (NamingException e) { throw new ServletException(e); } How would I connect using a JSP? Or would this be done in the javabean? TIA Tom K. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 - 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]
RE: Database connection going from servlet to a bean
Thanks, I will search the archives, ...you gave my an idea, it seems to me I could use the following code in my bean and call the getMatches() and forward the results to a ResultsPage.jsp. TIA Tom K. try{ Context env = (Context) new InitialContext().lookup(java:comp/env); pool = (DataSource) env.lookup(jdbc/myApp); if (pool == null) throw new ServletException(`jdbc/myApp' is an unknown DataSource); }catch (NamingException e) { throw new ServletException(e); } public int getMatches(){ try { /** Run prepared statement */ dbConnection = pool.getConnection(); PreparedStatement pstmt = dbConnection.prepareStatement(Display_Statement_AdInfoView); pstmt.setString(1,uniqueDateId); pstmt.setString(2,titlePage pstmt.setString(3,color); pstmt.setString(4,banner); pstmt.setBlob(5,myAppSays01); pstmt.setString(6,phone); pstmt.setString(7,email); pstmt.setString(8,webSite); rs = pstmt.executeQuery(); rs.last(); rowCount = rs.getRow(); dbConnection.close(); -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 1:42 PM To: Tomcat Users List Subject: RE: Database connection going from servlet to a bean Hi, Mike thanks for the feedback, but is this the practical solution? For example, I am using a connection pool, the init is only done once, the bean does the processing, after the processing it done (that is the beans set their properties) the results are forwarded to another jsp for viewing, so where do I release my connection back into the pool? Your question is a good argument for having the bean retrieve the connection, do its processing, and release the connection. The results you're forwarding can't be a java.sql.ResultSet, as that keeps the connection open, but some other object containing the processed results. Hand-in-hand with this approach goes the practice of getting a handle to your connection pool in a ServletContextListener. The listener can make a getConnectionPool() or getConnection() method available for use by your beans. This approach has several advantages over the servlet init (or jspInit for a JSP) design, all of which have been discussed in the past on this list so if you're interested you can search the archives. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: database connection in web.xml
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html -Tim Luke Vanderfluit wrote: Hi, I want to specify a database connection in the web.xml file for an application. How do I do this? Where can I find docs to describe it, Thanks, kind regards, Luke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: database connection
There is an discussion about the same at Sun. http://forum.java.sun.com/thread.jsp?thread=386190forum=48message=1660462 I would use a datasource or pool to ensure a flow in the application unless you're very sure, that your connection implementation allows concurrent statements to be executed and not just executes them one at a time. The link above reads : For example, two Statements on the same Connection can be executed concurrently and their ResultSets can be processed concurrently (from the perspective of the developer). Some drivers will provide this full concurrency. Others may execute one statement and wait until it completes before sending the next. Maby you should look at Jarkata' pool or look at some datasources. Few connections are good because fewer connections uses less memory and less cpu and therefore allows faster executions. But fewer connections also, depending on the complexity of the requests and size of the results, makes faster waits for those threads not in possession of a connection :@) Regards Kleth -- Kristian A. Leth Maersk Data Transport/Architects Specialists. -- Hans Wichman [EMAIL PROTECTED]To: [EMAIL PROTECTED] cc: 05-08-2003 21:29 Subject: database connection Please respond to Tomcat Users List Hi, I am evaluating a jsp application for a customer, which provides an interface to a database through some helperclasses. Each helper class manages the retrieval (and updates) of related underlying tables, and there are about 10 helperclasses. In the header (header.jsp) the jsp calls an initialize method on a Configuration object, checks if it is already initialized (this process is not synchronized), and if not, creates one connection, creates all the 10 helper classes as static instances passing this one-and-only connection. In the rest of the application a collection of tags call the static methods (unsynchronized) on the Configuration object, such as getDatabaseHelper1 (be it with a more descriptive name) and performs operations on the underlying database through this class. All the methods in the Helper classes are unsynchronized as well, but they are standalone (utility functions, I don't know a better way to describe it). My question is, except from any race conditions in the helper classes themselves, is it a problem that all those helper classes share only one connection and access it unsynchronized. If so, why is it a problem if unsynchronized communication occurs on a database connection? Or are all the underlying methods on the connection object already synchronized and is there no need to worry? Some pointers to why and how would be appreciated as well. And I am not only looking to why connection pooling would be good, but also why one connection would be bad ;-) kind regards Hans - 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]
RE: database connection pooling
Howdy, Why did you upgrade to 4.1.23? Or was that just a typo and you're really using 4.1.24 (as you should be)? ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Hans Wichman [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 3:38 AM To: [EMAIL PROTECTED] Subject: database connection pooling Hi, I emailed yesterday about a database connection pool being recreated on every lookup in the context, but after upgrading from tomcat 4.0.1 to tomcat 4.1.23 the problem disappeared. Apparently this is a bug in tomcat 4.0.1. So I you are developing in tomcat 4.0.1 and using connection pools beware ;-) Greetz Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: database connection pooling
Oops, yes that was a typo (phpdev423 is in the same directory with installers ;-))). greetz Hans At 08:51 AM 7/29/2003 -0400, Shapira, Yoav wrote: Howdy, Why did you upgrade to 4.1.23? Or was that just a typo and you're really using 4.1.24 (as you should be)? ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Hans Wichman [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 3:38 AM To: [EMAIL PROTECTED] Subject: database connection pooling Hi, I emailed yesterday about a database connection pool being recreated on every lookup in the context, but after upgrading from tomcat 4.0.1 to tomcat 4.1.23 the problem disappeared. Apparently this is a bug in tomcat 4.0.1. So I you are developing in tomcat 4.0.1 and using connection pools beware ;-) Greetz Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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]
Re: Database connection No suitable driver?
Yes. Then there is something wrong with JDBC URL you're using to connect. That message is actually from DriverManager/DataSource code. Nix.
RE: Database connection No suitable driver?
I found an example on www.sybase.com, searching for tomcat the first hit was an example about jconnect for JDBC not using taglib and I got it working properly. So now I will try to find out why taglib is not working properly. - Terje -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 14:51 To: Tomcat Users List Subject: Re: Database connection No suitable driver? Yes. Then there is something wrong with JDBC URL you're using to connect. That message is actually from DriverManager/DataSource code. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection No suitable driver? SOLVED
It seems that the problem was in context useNaming=true I had it false. Now it works fine in taglibs too. Thanks for all help. - Terje -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 22:05 To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? I found an example on www.sybase.com, searching for tomcat the first hit was an example about jconnect for JDBC not using taglib and I got it working properly. So now I will try to find out why taglib is not working properly. - Terje -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 14:51 To: Tomcat Users List Subject: Re: Database connection No suitable driver? Yes. Then there is something wrong with JDBC URL you're using to connect. That message is actually from DriverManager/DataSource code. Nix. - 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]
RE: Database connection No suitable driver? SOLVED
And crossContext=true that I also had set to false. - Terje -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 22:22 To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? SOLVED It seems that the problem was in context useNaming=true I had it false. Now it works fine in taglibs too. Thanks for all help. - Terje -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 22:05 To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? I found an example on www.sybase.com, searching for tomcat the first hit was an example about jconnect for JDBC not using taglib and I got it working properly. So now I will try to find out why taglib is not working properly. - Terje -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 14:51 To: Tomcat Users List Subject: Re: Database connection No suitable driver? Yes. Then there is something wrong with JDBC URL you're using to connect. That message is actually from DriverManager/DataSource code. Nix. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection No suitable driver?
We also put jdbc2_0-stdext.jar in the common/lib directy. -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 2:54 PM To: 'Tomcat Users List' Subject: Database connection No suitable driver? Hello, I have to ask you once again. I have tried to get a connection to my Sybaseserver. I get no suitable driver when trying to connect. Do anyone have a suggestion on what is wrong. Sybase driver file jconn2.jar is placed under $CATALINA/common/lib. It is a long mail but I hope anyone will look at it. - Terje org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: No suitable driver at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) . I have an example that is working: ... %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application driver=com.sybase.jdbc2.jdbc.SybDriver url=jdbc:sybase:Tds:x: user= password=pwdpwd / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query Liste :br c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach /body /html - And one that is not working. . %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application dataSource=javax.sql.DataSource / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach --- My web.xml is lik this. context-param param-name javax.sql.DataSource /param-name param-value jdbc:sybase:Tds:xx:,com.sybase.jdbc2.jdbc.SybDriver,,pwdpwd /param-value /context-param -- OR LIKE THIS resource-ref descriptionDB Connection/description res-ref-namejdbc/resDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref -- server.xml Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=dbtest docBase=c:\usr\utvikl\dbtest mapperClass=org.apache.catalina.core.StandardContextMapper path=/dbtest privileged=false reloadable=true swallowOutput=false useNaming=false wrapperClass=org.apache.catalina.core.StandardWrapper Resource name=jdbc/resDB scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/resDB parameter namevalidationQuery/name value/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuepwdpwd/value /parameter parameter nameurl/name valuejdbc:sybase:Tds::/value /parameter parameter namedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name value/value /parameter /ResourceParams /Context --
RE: Database connection No suitable driver?
It is there. Tomcat version is 4.1.24. - Terje -Original Message- From: John Moore [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 00:05 To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? We also put jdbc2_0-stdext.jar in the common/lib directy. -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 2:54 PM To: 'Tomcat Users List' Subject: Database connection No suitable driver? Hello, I have to ask you once again. I have tried to get a connection to my Sybaseserver. I get no suitable driver when trying to connect. Do anyone have a suggestion on what is wrong. Sybase driver file jconn2.jar is placed under $CATALINA/common/lib. It is a long mail but I hope anyone will look at it. - Terje org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: No suitable driver at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) . I have an example that is working: ... %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application driver=com.sybase.jdbc2.jdbc.SybDriver url=jdbc:sybase:Tds:x: user= password=pwdpwd / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query Liste :br c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach /body /html - And one that is not working. . %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application dataSource=javax.sql.DataSource / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach --- My web.xml is lik this. context-param param-name javax.sql.DataSource /param-name param-value jdbc:sybase:Tds:xx:,com.sybase.jdbc2.jdbc.SybDriver,,pwdpwd /param-value /context-param -- OR LIKE THIS resource-ref descriptionDB Connection/description res-ref-namejdbc/resDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref -- server.xml Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=dbtest docBase=c:\usr\utvikl\dbtest mapperClass=org.apache.catalina.core.StandardContextMapper path=/dbtest privileged=false reloadable=true swallowOutput=false useNaming=false wrapperClass=org.apache.catalina.core.StandardWrapper Resource name=jdbc/resDB scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/resDB parameter namevalidationQuery/name value/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuepwdpwd/value /parameter parameter nameurl/name valuejdbc:sybase:Tds::/value /parameter parameter namedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name value/value /parameter /ResourceParams /Context -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection No suitable driver?
One other idea, we have the Resource and ResourceParams in the GlobalNamingResources and a ResourceLink in the application context. Using 4.1.24LE. We also had to put commons-dbcp and commons-pool into commons/lib, these are not included in LE. John -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 3:12 PM To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? It is there. Tomcat version is 4.1.24. - Terje -Original Message- From: John Moore [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 00:05 To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? We also put jdbc2_0-stdext.jar in the common/lib directy. -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 2:54 PM To: 'Tomcat Users List' Subject: Database connection No suitable driver? Hello, I have to ask you once again. I have tried to get a connection to my Sybaseserver. I get no suitable driver when trying to connect. Do anyone have a suggestion on what is wrong. Sybase driver file jconn2.jar is placed under $CATALINA/common/lib. It is a long mail but I hope anyone will look at it. - Terje org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: No suitable driver at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) . I have an example that is working: ... %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application driver=com.sybase.jdbc2.jdbc.SybDriver url=jdbc:sybase:Tds:x: user= password=pwdpwd / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query Liste :br c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach /body /html - And one that is not working. . %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application dataSource=javax.sql.DataSource / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach --- My web.xml is lik this. context-param param-name javax.sql.DataSource /param-name param-value jdbc:sybase:Tds:xx:,com.sybase.jdbc2.jdbc.SybDriver,,pwdpwd /param-value /context-param -- OR LIKE THIS resource-ref descriptionDB Connection/description res-ref-namejdbc/resDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref -- server.xml Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=dbtest docBase=c:\usr\utvikl\dbtest mapperClass=org.apache.catalina.core.StandardContextMapper path=/dbtest privileged=false reloadable=true swallowOutput=false useNaming=false wrapperClass=org.apache.catalina.core.StandardWrapper Resource name=jdbc/resDB scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/resDB parameter namevalidationQuery/name value/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuepwdpwd/value /parameter parameter nameurl/name valuejdbc:sybase:Tds::/value /parameter parameter namedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name value/value /parameter /ResourceParams /Context -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Database connection No suitable driver?
Your config looks fine. Have you placed Sybase's JDBC driver into ${CATALINA_HOME}/common/lib/? Nix.
RE: Database connection No suitable driver?
Yes. - Terje -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 07:24 To: Tomcat Users List Subject: Re: Database connection No suitable driver? Your config looks fine. Have you placed Sybase's JDBC driver into ${CATALINA_HOME}/common/lib/? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection No suitable driver?
I tried this now but I still get the same error. - Terje -Original Message- From: John Moore [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 00:41 To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? One other idea, we have the Resource and ResourceParams in the GlobalNamingResources and a ResourceLink in the application context. Using 4.1.24LE. We also had to put commons-dbcp and commons-pool into commons/lib, these are not included in LE. John -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 3:12 PM To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? It is there. Tomcat version is 4.1.24. - Terje -Original Message- From: John Moore [mailto:[EMAIL PROTECTED] Sent: 3. juni 2003 00:05 To: 'Tomcat Users List' Subject: RE: Database connection No suitable driver? We also put jdbc2_0-stdext.jar in the common/lib directy. -Original Message- From: Terje Hopsø [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 2:54 PM To: 'Tomcat Users List' Subject: Database connection No suitable driver? Hello, I have to ask you once again. I have tried to get a connection to my Sybaseserver. I get no suitable driver when trying to connect. Do anyone have a suggestion on what is wrong. Sybase driver file jconn2.jar is placed under $CATALINA/common/lib. It is a long mail but I hope anyone will look at it. - Terje org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: No suitable driver at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) . I have an example that is working: ... %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application driver=com.sybase.jdbc2.jdbc.SybDriver url=jdbc:sybase:Tds:x: user= password=pwdpwd / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query Liste :br c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach /body /html - And one that is not working. . %@ page language=java % %@ page import=java.lang.* % %@ page import=java.util.* % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % body sql:setDataSource var=ex scope=application dataSource=javax.sql.DataSource / sql:query var=rader dataSource=${ex} select Initialer from Skytter /sql:query c:forEach items=${rader.rows} var=rad c:out value=${rad.Initialer} /br /c:forEach --- My web.xml is lik this. context-param param-name javax.sql.DataSource /param-name param-value jdbc:sybase:Tds:xx:,com.sybase.jdbc2.jdbc.SybDriver,,pwdpwd /param-value /context-param -- OR LIKE THIS resource-ref descriptionDB Connection/description res-ref-namejdbc/resDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref -- server.xml Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 displayName=dbtest docBase=c:\usr\utvikl\dbtest mapperClass=org.apache.catalina.core.StandardContextMapper path=/dbtest privileged=false reloadable=true swallowOutput=false useNaming=false wrapperClass=org.apache.catalina.core.StandardWrapper Resource name=jdbc/resDB scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/resDB parameter namevalidationQuery/name value/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuepwdpwd/value /parameter parameter nameurl/name valuejdbc:sybase:Tds::/value /parameter parameter namedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name value/value /parameter /ResourceParams /Context
Re: DataBase connection pooling.
Andoni: Tomcat 4.1.x uses the Database Connection Pool from the Apache Commons Project. by default, meaning it is also shipped with it. This is what I have been using and have not come across any problems that effect the web applications I develop. Thanks, Ej Andoni [EMAIL PROTECTED] on 12/16/2002 08:14:07 AM Please respond to Tomcat Users List [EMAIL PROTECTED] To:Tomcat Users List [EMAIL PROTECTED] cc: Subject:DataBase connection pooling. Hello, Do you all write your own connection pooling code or is there some open source software to do this? Also has anybody gotten deployment of .war files to work with unpackWARs=false? Thanks, Andoni. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** Confidentiality Notice: This email message, including any attachments, contains or may contain confidential information intended only for the addressee. If you are not an intended recipient of this message, be advised that any reading, dissemination, forwarding, printing, copying or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by reply message and delete this email message and any attachments from your system. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DataBase connection pooling.
I use the connection pool that comes with Tomcat 4.1.12 to connect my servlets to an IBM DB2 7.1 database and apart an initial problem in configuring Tomcat all works fine. Greetings Mauro Brändle Andoni wrote: Hello, Do you all write your own connection pooling code or is there some open source software to do this? Also has anybody gotten deployment of .war files to work with unpackWARs=false? Thanks, Andoni. -- 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: Database connection - Catalina
I put jdbc driver in all directories, in regular directory and in jar file. In Tomcat 3.2 it worked, not in 4.0. Pawel -Original Message- From: John Gregg [mailto:[EMAIL PROTECTED]] Sent: Monday, June 17, 2002 7:12 PM To: 'Tomcat Users List' Subject: RE: Database connection - Catalina Tomcat probably isn't finding your jdbc driver. The exception's getMessage() method is returning a class name, which usually means ClassNotFoundException or ClassCastException. Read this: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html john -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]. org]On Behalf Of Skorupski Pawel ,(PZUZ) Sent: Monday, June 17, 2002 7:32 AM To: '[EMAIL PROTECTED]' Subject: Database connection - Catalina Hello, I've got a problem with Tomcat 4.0 (Catalina). After setting up REALM: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority?user=testamp;password=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / I can not connect to mysql server which is running on localhost. The error I received is: Catalina.start:Lifecycle Exception: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver I ran through many faq's lists and the only solution I found was: check tables, all names etc. I've checked not twice but ten times receiving the same type of error. I use FORM type of authentication. Everything was ok with Tomcat 3.2 and got worse after installing new version of Tomcat. Libraries: org.jar, servlet.jar are added to classpath. I would be grateful for any help. Pawel -- 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: Database connection - Catalina
you have to put all your jar files in common/lib. Regards, Vikramjit Singh, Systems Engineer, GTL Ltd. Ph. 7612929-1031 -Original Message- From: Skorupski Pawel ,(PZUZ) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 19, 2002 1:34 AM To: 'Tomcat Users List' Subject: RE: Database connection - Catalina I put jdbc driver in all directories, in regular directory and in jar file. In Tomcat 3.2 it worked, not in 4.0. Pawel -Original Message- From: John Gregg [mailto:[EMAIL PROTECTED]] Sent: Monday, June 17, 2002 7:12 PM To: 'Tomcat Users List' Subject: RE: Database connection - Catalina Tomcat probably isn't finding your jdbc driver. The exception's getMessage() method is returning a class name, which usually means ClassNotFoundException or ClassCastException. Read this: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html john -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]. org]On Behalf Of Skorupski Pawel ,(PZUZ) Sent: Monday, June 17, 2002 7:32 AM To: '[EMAIL PROTECTED]' Subject: Database connection - Catalina Hello, I've got a problem with Tomcat 4.0 (Catalina). After setting up REALM: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority?user=testamp;password=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / I can not connect to mysql server which is running on localhost. The error I received is: Catalina.start:Lifecycle Exception: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver I ran through many faq's lists and the only solution I found was: check tables, all names etc. I've checked not twice but ten times receiving the same type of error. I use FORM type of authentication. Everything was ok with Tomcat 3.2 and got worse after installing new version of Tomcat. Libraries: org.jar, servlet.jar are added to classpath. I would be grateful for any help. Pawel -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Database connection - Catalina
Writing that I put jar files in all directories I meant in all directories where they should be ,so: common/lib /lib webapps/dss/WEB-INF/lib Pawel -Original Message- From: Vikramjit Singh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 19, 2002 10:27 AM To: 'Tomcat Users List' Subject: RE: Database connection - Catalina you have to put all your jar files in common/lib. Regards, Vikramjit Singh, Systems Engineer, GTL Ltd. Ph. 7612929-1031 -Original Message- From: Skorupski Pawel ,(PZUZ) [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 19, 2002 1:34 AM To: 'Tomcat Users List' Subject: RE: Database connection - Catalina I put jdbc driver in all directories, in regular directory and in jar file. In Tomcat 3.2 it worked, not in 4.0. Pawel -Original Message- From: John Gregg [mailto:[EMAIL PROTECTED]] Sent: Monday, June 17, 2002 7:12 PM To: 'Tomcat Users List' Subject: RE: Database connection - Catalina Tomcat probably isn't finding your jdbc driver. The exception's getMessage() method is returning a class name, which usually means ClassNotFoundException or ClassCastException. Read this: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html john -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]. org]On Behalf Of Skorupski Pawel ,(PZUZ) Sent: Monday, June 17, 2002 7:32 AM To: '[EMAIL PROTECTED]' Subject: Database connection - Catalina Hello, I've got a problem with Tomcat 4.0 (Catalina). After setting up REALM: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority?user=testamp;password=test userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / I can not connect to mysql server which is running on localhost. The error I received is: Catalina.start:Lifecycle Exception: Exception opening database connection: java.sql.SQLException: org.gjt.mm.mysql.Driver I ran through many faq's lists and the only solution I found was: check tables, all names etc. I've checked not twice but ten times receiving the same type of error. I use FORM type of authentication. Everything was ok with Tomcat 3.2 and got worse after installing new version of Tomcat. Libraries: org.jar, servlet.jar are added to classpath. I would be grateful for any help. Pawel -- 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] -- 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: Database connection Pooling and other questions
Gerry Have you had a look at: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html Tyrex and all... I think this should help, unless I am missing something completely.. cheers Sanjay -Original Message- From: Gerry Duhig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002 1:58 PM To: [EMAIL PROTECTED]; Tomcat Users List Subject: Database connection Pooling and other questions Hi! We currently have a couple of sites running JBoss-Tomcat. A third application that used the JBoss part of this setup has been canned leaving us with two non-EJB applications. As far as I can determine the only benefits we currently get from JBoss are the security system and connection pooling on our database connections. Security I could do within Tomcat - what about connection pooling? IS there anythung available within or as a simple add-on to tomcat that can supply connection pooling. If there is we may drop JBoss as the latest Jboss2.4/Tomcat4.0.1 package seems to have a few problems - no way to read server.xml etc. Anyone any comments? Gerry -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Database connection pool scope
I have few questions : 1. What the implementations for connection caches are availablis ? 2. In what advantages of such products before vendors drivers that is supporting JDBC API 2.0 (ConnectionPoolDataSource) 3. Can I call my method ( not doPost(),doGet(),service() ) from other servlet ? This method - multithreading ? - Original Message - From: "Jon Crater" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 26, 2001 6:35 PM Subject: Re: Database connection pool scope the singleton is just a concrete java class that ensures only one instance can ever be instantiated. i ensure this via this method: public static synchronized ConnectionPool getInstance() throws SQLException { if (instance == null) { instance = new ConnectionPool(driver,url,username,password, initialConnections,maxConnections, waitIfBusy); } return instance; } this class is no different than any other class. the important part of making the connection pool available to the rest of your application is storing the reference to the pool in the servlet context. once you've done this, and assuming your connectionbroker class is a servlet with access to the servlet context containing the connection pool reference, you can call getConnection() and releaseConnection() on the servlet class, which in turn gets and returns connections from/to the connection pool. Original Message Follows From: "Valeriy Molyakov" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Database connection pool scope Date: Mon, 26 Feb 2001 18:12:15 +0200 Two questions: What is the singleton? Where it is possible to receive such class ? - Original Message - From: "Jon Crater" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 26, 2001 5:17 PM Subject: RE: Database connection pool scope i use a connection pool in tomcat 3.2.1. i have a servlet, ConnectionBroker.java, which, in its init() method checks for the existence of the connection pool. if the connection pool is null, it creates an instance of it and binds it to the servlet context. then other classes can call this class' static getConnection() and releaseConnection() methods without having to worry about whether they extend HttpServlet. the init method looks like this: public void init() { ServletContext ctx = getServletContext(); jdbcPool = (ConnectionPool)ctx.getAttribute("jdbcPool"); if (jdbcPool == null) { try { jdbcPool = ConnectionPool.getInstance(); ctx.setAttribute("jdbcPool", jdbcPool); } catch (SQLException sqle) { debug("SQLException caught: " + sqle.getMessage()); } } } the getConnection() method looks like this: public static Connection getConnection() throws SQLException { return jdbcPool.getConnection(); } i then have a singleton ConnectionPool class which creates and manages jdbc connections. -jc Original Message Follows From: Randy Layman [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: Database connection pool scope Date: Mon, 26 Feb 2001 07:58:53 -0500 First of all, there are several connection pools avaiable, so you might want to look at those before you decide that re-inventing the wheel is a good thing. Second, most connection pools work by using static classes. Your code would look something like: Connection conn = ConnectionPool.getConnection(); and the ConnectionPool would look something like: public static Connection getConnection() Randy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 5:17 AM To: [EMAIL PROTECTED] Subject: Database connection pool scope Hello everybody, I am pretty new to Tomcat, but previously developed applications for other Java application servers (mostly Bea Weblogic). We want to set up a database connection pool to enhance performance, but we are making database connections using our class libraries; not directly from servlets / JSPs... To use a pool inside a JSP I would simply create an application object or a JavaBean and use it. But inside a class; I cannot use Tomcat's application scope. In Weblogic, there is a special "workspace" class, which instantiates with the server startup and is available to other classes in the application (this is very similar to the application object in JSPs
RE: Database connection pool scope
First of all, there are several connection pools avaiable, so you might want to look at those before you decide that re-inventing the wheel is a good thing. Second, most connection pools work by using static classes. Your code would look something like: Connection conn = ConnectionPool.getConnection(); and the ConnectionPool would look something like: public static Connection getConnection() Randy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 5:17 AM To: [EMAIL PROTECTED] Subject: Database connection pool scope Hello everybody, I am pretty new to Tomcat, but previously developed applications for other Java application servers (mostly Bea Weblogic). We want to set up a database connection pool to enhance performance, but we are making database connections using our class libraries; not directly from servlets / JSPs... To use a pool inside a JSP I would simply create an application object or a JavaBean and use it. But inside a class; I cannot use Tomcat's application scope. In Weblogic, there is a special "workspace" class, which instantiates with the server startup and is available to other classes in the application (this is very similar to the application object in JSPs - but you can use it everywhere). Is there a counterpart in Tomcat? If not, how can I implement a connection pool which is available to the business classes that I wrote. Thanks in advance. Selcuk Ayguney - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Database connection pool scope
i use a connection pool in tomcat 3.2.1. i have a servlet, ConnectionBroker.java, which, in its init() method checks for the existence of the connection pool. if the connection pool is null, it creates an instance of it and binds it to the servlet context. then other classes can call this class' static getConnection() and releaseConnection() methods without having to worry about whether they extend HttpServlet. the init method looks like this: public void init() { ServletContext ctx = getServletContext(); jdbcPool = (ConnectionPool)ctx.getAttribute("jdbcPool"); if (jdbcPool == null) { try { jdbcPool = ConnectionPool.getInstance(); ctx.setAttribute("jdbcPool", jdbcPool); } catch (SQLException sqle) { debug("SQLException caught: " + sqle.getMessage()); } } } the getConnection() method looks like this: public static Connection getConnection() throws SQLException { return jdbcPool.getConnection(); } i then have a singleton ConnectionPool class which creates and manages jdbc connections. -jc Original Message Follows From: Randy Layman [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: Database connection pool scope Date: Mon, 26 Feb 2001 07:58:53 -0500 First of all, there are several connection pools avaiable, so you might want to look at those before you decide that re-inventing the wheel is a good thing. Second, most connection pools work by using static classes. Your code would look something like: Connection conn = ConnectionPool.getConnection(); and the ConnectionPool would look something like: public static Connection getConnection() Randy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 5:17 AM To: [EMAIL PROTECTED] Subject: Database connection pool scope Hello everybody, I am pretty new to Tomcat, but previously developed applications for other Java application servers (mostly Bea Weblogic). We want to set up a database connection pool to enhance performance, but we are making database connections using our class libraries; not directly from servlets / JSPs... To use a pool inside a JSP I would simply create an application object or a JavaBean and use it. But inside a class; I cannot use Tomcat's application scope. In Weblogic, there is a special "workspace" class, which instantiates with the server startup and is available to other classes in the application (this is very similar to the application object in JSPs - but you can use it everywhere). Is there a counterpart in Tomcat? If not, how can I implement a connection pool which is available to the business classes that I wrote. Thanks in advance. Selcuk Ayguney - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Database connection pool scope
Two questions: What is the singleton? Where it is possible to receive such class ? - Original Message - From: "Jon Crater" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 26, 2001 5:17 PM Subject: RE: Database connection pool scope i use a connection pool in tomcat 3.2.1. i have a servlet, ConnectionBroker.java, which, in its init() method checks for the existence of the connection pool. if the connection pool is null, it creates an instance of it and binds it to the servlet context. then other classes can call this class' static getConnection() and releaseConnection() methods without having to worry about whether they extend HttpServlet. the init method looks like this: public void init() { ServletContext ctx = getServletContext(); jdbcPool = (ConnectionPool)ctx.getAttribute("jdbcPool"); if (jdbcPool == null) { try { jdbcPool = ConnectionPool.getInstance(); ctx.setAttribute("jdbcPool", jdbcPool); } catch (SQLException sqle) { debug("SQLException caught: " + sqle.getMessage()); } } } the getConnection() method looks like this: public static Connection getConnection() throws SQLException { return jdbcPool.getConnection(); } i then have a singleton ConnectionPool class which creates and manages jdbc connections. -jc Original Message Follows From: Randy Layman [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: Database connection pool scope Date: Mon, 26 Feb 2001 07:58:53 -0500 First of all, there are several connection pools avaiable, so you might want to look at those before you decide that re-inventing the wheel is a good thing. Second, most connection pools work by using static classes. Your code would look something like: Connection conn = ConnectionPool.getConnection(); and the ConnectionPool would look something like: public static Connection getConnection() Randy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 5:17 AM To: [EMAIL PROTECTED] Subject: Database connection pool scope Hello everybody, I am pretty new to Tomcat, but previously developed applications for other Java application servers (mostly Bea Weblogic). We want to set up a database connection pool to enhance performance, but we are making database connections using our class libraries; not directly from servlets / JSPs... To use a pool inside a JSP I would simply create an application object or a JavaBean and use it. But inside a class; I cannot use Tomcat's application scope. In Weblogic, there is a special "workspace" class, which instantiates with the server startup and is available to other classes in the application (this is very similar to the application object in JSPs - but you can use it everywhere). Is there a counterpart in Tomcat? If not, how can I implement a connection pool which is available to the business classes that I wrote. Thanks in advance. Selcuk Ayguney - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: database connection problem when run nt service
Thanks Steve and Jared, after changing user DSN to System DSN, it worked. The nt service is also worked after logoff when it started with jdk1.2.2 From: Steve Ruby [EMAIL PROTECTED] Make sure the DSN you are trying to get to is a System DSN and not a User DSN, tomcat will run as a different user when run as a service unless you specify otherwise. User DSN can only be seen by the user it was created by. H Deng wrote: Thanks for the tip. It does not seem to be related with the user permission since the same code works fine when tomcat is running as a stand alone application(startup). The problem only appears when tomcat is running as a service(net start jakarta). The exception I get is java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. From: Jared Clinton [EMAIL PROTECTED] I am extremly new to tomcat, although I suspect that it is to do with the NT user that tha service logs in as and the permissions in the database that the user has? ?Stab in the dark? Jared Clinton. -Original Message- From: H Deng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 December 2000 17:10 Hi everyone, I installed apache 1.3.4 and tomcat 3.2.1 on windows NT4.0 /windows 2000 and tried to set up tomcat to run NT service. I used mod_jk.dll to test a simple java code to connect to a database and it worked fine. However, when I tried to use jk_nt_service.exe, other part of the the java program can run but the connection to the database can't be establised. The following code gives a SQLException: dbCon =3D DriverManager.getConnection("jdbc:odbc:book"); but the same code worked fine with mod_jk.dll. I tried to put rt.jar (which contains DriverManager.class) in the classpath in wrapper.properties: wrapper.class_path=3D$(wrapper.java_home)\jre\lib\rt.jar but it did not help. Please help me. Thanks in advance. _ Get your FREE download of MSN Explorer at http://explorer.msn.com _ Get your FREE download of MSN Explorer at http://explorer.msn.com
RE: database connection problem when run nt service
Thanks for the tip. It does not seem to be related with the user permission since the same code works fine when tomcat is running as a stand alone application(startup). The problem only appears when tomcat is running as a service(net start jakarta). The exception I get is java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. From: Jared Clinton [EMAIL PROTECTED] I am extremly new to tomcat, although I suspect that it is to do with the NT user that tha service logs in as and the permissions in the database that the user has? ?Stab in the dark? Jared Clinton. -Original Message- From: H Deng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 December 2000 17:10 Hi everyone, I installed apache 1.3.4 and tomcat 3.2.1 on windows NT4.0 /windows 2000 and tried to set up tomcat to run NT service. I used mod_jk.dll to test a simple java code to connect to a database and it worked fine. However, when I tried to use jk_nt_service.exe, other part of the the java program can run but the connection to the database can't be establised. The following code gives a SQLException: dbCon =3D DriverManager.getConnection("jdbc:odbc:book"); but the same code worked fine with mod_jk.dll. I tried to put rt.jar (which contains DriverManager.class) in the classpath in wrapper.properties: wrapper.class_path=3D$(wrapper.java_home)\jre\lib\rt.jar but it did not help. Please help me. Thanks in advance. _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: database connection problem when run nt service
Make sure the DSN you are trying to get to is a System DSN and not a User DSN, tomcat will run as a different user when run as a service unless you specify otherwise. User DSN can only be seen by the user it was created by. H Deng wrote: Thanks for the tip. It does not seem to be related with the user permission since the same code works fine when tomcat is running as a stand alone application(startup). The problem only appears when tomcat is running as a service(net start jakarta). The exception I get is java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. From: Jared Clinton [EMAIL PROTECTED] I am extremly new to tomcat, although I suspect that it is to do with the NT user that tha service logs in as and the permissions in the database that the user has? ?Stab in the dark? Jared Clinton. -Original Message- From: H Deng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 December 2000 17:10 Hi everyone, I installed apache 1.3.4 and tomcat 3.2.1 on windows NT4.0 /windows 2000 and tried to set up tomcat to run NT service. I used mod_jk.dll to test a simple java code to connect to a database and it worked fine. However, when I tried to use jk_nt_service.exe, other part of the the java program can run but the connection to the database can't be establised. The following code gives a SQLException: dbCon =3D DriverManager.getConnection("jdbc:odbc:book"); but the same code worked fine with mod_jk.dll. I tried to put rt.jar (which contains DriverManager.class) in the classpath in wrapper.properties: wrapper.class_path=3D$(wrapper.java_home)\jre\lib\rt.jar but it did not help. Please help me. Thanks in advance. _ Get your FREE download of MSN Explorer at http://explorer.msn.com
RE: database connection problem when run nt service
I am extremly new to tomcat, although I suspect that it is to do with the NT user that tha service logs in as and the permissions in the database that the user has? ?Stab in the dark? Jared Clinton. -Original Message- From: H Deng [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 December 2000 17:10 To: [EMAIL PROTECTED] Subject: database connection problem when run nt service Hi everyone, I installed apache 1.3.4 and tomcat 3.2.1 on windows NT4.0 /windows 2000 and tried to set up tomcat to run NT service. I used mod_jk.dll to test a simple java code to connect to a database and it worked fine. However, when I tried to use jk_nt_service.exe, other part of the the java program can run but the connection to the database can't be establised. The following code gives a SQLException: dbCon =3D DriverManager.getConnection("jdbc:odbc:book"); but the same code worked fine with mod_jk.dll. I tried to put rt.jar (which contains DriverManager.class) in the classpath in wrapper.properties: wrapper.class_path=3D$(wrapper.java_home)\jre\lib\rt.jar but it did not help. Please help me. Thanks in advance. _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: Database connection pooling
The bitmechanic connection pool is excellent. Easy to use and free, opensource. What more does anyone want? Dave - Original Message - From: "Edson Carlos Ericksson Richter" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 12, 2000 3:12 PM Subject: RES: Database connection pooling We are currently using Bitmechanic JDBC Pool, and is very - really very - stable (with MSSQL FreeTDS driver and Oracle driver). And best: is free. Edson Richter - Mensagem original - De: Martino, Karl [SMTP:[EMAIL PROTECTED]] Enviada em: terça-feira, 12 de dezembro de 2000 15:14 Para: [EMAIL PROTECTED] Assunto: Database connection pooling We are currently evaluating our our application's database connection pooling and I would love to hear what others have discovered as best practices and traps. We are using MS SQLServer with JTurbo as our JDBC driver. Our database pooling classes are based upon source code downloaded from Wrox. Are there industrial strength database pooling classes available to purchase? Should we continue to write our own (we've experienced difficulties...)? Does Tomcat, like some other servlet containers, include database pooling somewhere? Thanks, -Karl
Re: Database connection pooling with tomcat
- Original Message - From: Kaushal Patel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 22, 2000 10:46 AM Subject: Database connection pooling with tomcat Question What is the best way to do connection pooling to multiple oracle database with tomcat ? Hello All I have posted this message yesterday but haven't gotten any reply so trying it again to-day hope some one will be able to offer some help / thoughts I am trying to get he Pool Manger working I have a Redhat Linux 6.1 box with Apache Tomcat 3.1 on it, my jsp pages work fine I am able to get connection to databases using Oracle type 4 jdbc thin driver I have downloaded PoolMan v1.4 from codestudio.com and am trying to set-up connection pooling I have done all the classpath setting as per the install doc still I keep getting a message saying classNotfound exception nullpointer exception What am I missing any help would be appreciated !! Question 1 Has anyone got this working ? Question 2 What is the best way to do connection pooling with tomcat ? Thanks in advance, Thanks, KPatel P.S. I tired running the test PoolMan.jsp util page they provide and got this below message ResultSet ERROR: Unable to process query. Please verify that PoolMan.jar and your JDBC Driver are in your application server's CLASSPATH. If the problem continues, try testing your database and JDBC configuration via PoolManSample from the command line. ERROR: Unable to process query. Please verify that PoolMan.jar and your JDBC Driver are in your application server's CLASSPATH.
Re: Database connection pooling with tomcat
Hi, Kaushal, I haven't used that specific conn pool, but looks like that you are having a CLASSPATH problem. - first, make sure that your drivers (and your poolmanager jars) are available using the global classpath of Tomcat. You'll have to modify startup.sh in order to include them in the classpath. - Normally Oracle thin drivers are shipped as a zip file (classes111.zip), and seems that Tomcat does not read zip files. I just renamed them to .jar and everything worked fine. Julio - Original Message - From: Kaushal Patel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 22, 2000 10:46 AM Subject: Database connection pooling with tomcat Question What is the best way to do connection pooling to multiple oracle database with tomcat ? Hello All I have posted this message yesterday but haven't gotten any reply so trying it again to-day hope some one will be able to offer some help / thoughts I am trying to get he Pool Manger working I have a Redhat Linux 6.1 box with Apache Tomcat 3.1 on it, my jsp pages work fine I am able to get connection to databases using Oracle type 4 jdbc thin driver I have downloaded PoolMan v1.4 from codestudio.com and am trying to set-up connection pooling I have done all the classpath setting as per the install doc still I keep getting a message saying classNotfound exception nullpointer exception What am I missing any help would be appreciated !! Question 1 Has anyone got this working ? Question 2 What is the best way to do connection pooling with tomcat ? Thanks in advance, Thanks, KPatel P.S. I tired running the test PoolMan.jsp util page they provide and got this below message ResultSet ERROR: Unable to process query. Please verify that PoolMan.jar and your JDBC Driver are in your application server's CLASSPATH. If the problem continues, try testing your database and JDBC configuration via PoolManSample from the command line. ERROR: Unable to process query. Please verify that PoolMan.jar and your JDBC Driver are in your application server's CLASSPATH.
Re: Database connection pooling with tomcat
What am I missing any help would be appreciated !! Question 1 Has anyone got this working ? Yep Question 2 What is the best way to do connection pooling with tomcat ? *shrug* I use PoolMan 1.4 too. P.S. I tired running the test PoolMan.jsp util page they provide and got this below message ResultSet ERROR: Unable to process query. Please verify that PoolMan.jar and your JDBC Driver are in your application server's CLASSPATH. If the problem continues, try testing your database and JDBC configuration via PoolManSample from the command line. Sounds like you need to put the JDBC driver .jar file and the PoolMan .jar file into your Tomcat /lib directory. If you're using 3.2 it'll then automatically find it when you start Tomcat. Also put the properties file which defines which database / user / password the connection pool should try and connect to. Regards, Dan
Re: Database connection pooling with tomcat
One thing I noticed with PoolMan is that you must have all the drivers for each configured database in the poolman.props file. In my instance I only wanted to use mySQL which required me to comment out the Postgres and Oracle configurations since I didn't have the drivers for them. My guess is that PoolMan preloads all the configured databases even though you may never use them. -- Mike - Original Message - From: "Julio Serje (@canada.com)" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 22, 2000 11:50 AM Subject: Re: Database connection pooling with tomcat - Original Message - From: Kaushal Patel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 22, 2000 10:46 AM Subject: Database connection pooling with tomcat Question What is the best way to do connection pooling to multiple oracle database with tomcat ? Hello All I have posted this message yesterday but haven't gotten any reply so trying it again to-day hope some one will be able to offer some help / thoughts I am trying to get he Pool Manger working I have a Redhat Linux 6.1 box with Apache Tomcat 3.1 on it, my jsp pages work fine I am able to get connection to databases using Oracle type 4 jdbc thin driver I have downloaded PoolMan v1.4 from codestudio.com and am trying to set-up connection pooling I have done all the classpath setting as per the install doc still I keep getting a message saying classNotfound exception nullpointer exception What am I missing any help would be appreciated !! Question 1 Has anyone got this working ? Question 2 What is the best way to do connection pooling with tomcat ? Thanks in advance, Thanks, KPatel P.S. I tired running the test PoolMan.jsp util page they provide and got this below message ResultSet ERROR: Unable to process query. Please verify that PoolMan.jar and your JDBC Driver are in your application server's CLASSPATH. If the problem continues, try testing your database and JDBC configuration via PoolManSample from the command line. ERROR: Unable to process query. Please verify that PoolMan.jar and your JDBC Driver are in your application server's CLASSPATH.