Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 79261 invoked from network); 22 Feb 2005 12:20:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Feb 2005 12:20:16 -0000 Received: (qmail 72124 invoked by uid 500); 22 Feb 2005 12:19:45 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 72054 invoked by uid 500); 22 Feb 2005 12:19:45 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 72001 invoked by uid 99); 22 Feb 2005 12:19:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from pcsbom.patni.com (HELO pcsbom.patni.com) (203.124.139.208) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 22 Feb 2005 04:19:42 -0800 Received: from rakshak.patni.com (rakshak.patni.com [203.124.139.54]) by pcsbom.patni.com (8.12.11/8.12.11) with SMTP id j1MCIZUR024136 for ; Tue, 22 Feb 2005 17:50:37 +0530 Received: from spzha1.patni.com ([192.168.0.6]) by rakshak.patni.com (SMSSMTP 4.0.0.59) with SMTP id M2005022217491604733 for ; Tue, 22 Feb 2005 17:49:16 +0530 Received: from pcp4904 ([192.168.7.242]) (authenticated bits=0) by spzha1.patni.com (8.12.11/8.12.9) with ESMTP id j1MCK2QN012562 for ; Tue, 22 Feb 2005 17:50:02 +0530 Reply-To: From: "Reshma Bhatia" To: Subject: Re: JDBC connection - Please help Date: Tue, 22 Feb 2005 17:49:06 +0530 Message-ID: <003d01c518d8$b4da38d0$f207a8c0@patni.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_003E_01C51906.CE9274D0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-Scanned-By: MIMEDefang 2.43 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_NextPart_000_003E_01C51906.CE9274D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Looks like you are using the Tomcat Connection pool. Refer to the attached Readme.txt file and verify that you have done these steps. I think it should solve your problem. Have also attached the server.xml & web.xml files which worked fine for us. let me know whether ur problem gets solved by this. -----Original Message----- From: deepak suldhal [mailto:deepakatfre@yahoo.com] Sent: Monday, February 21, 2005 11:53 AM To: tomcat users Subject: JDBC connection - Please help Please help me make my first JDBC connection My web.xml MySQL Test App DB Connection jdbc/TestDB javax.sql.DataSource Container ---------------------------------------------------------------------------- --- In server.xml I have the following context ( trying to connect to Sybase database) ---------------------------------------------------------------------------- --- I have copied the JDCB drive Jar under commons/lib I have a test.jsp as follows ---------------------------------------------------------------------------- --- <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> select id, foo, bar from testdata DB Test

Results

Foo ${row.foo}
Bar ${row.bar}
---------------------------------------------------------------------------- --- My directory structue is as follows webapps/DBTest/WEB-INF/web.mxl /DBTest/test.jsp ---------------------------------------------------------------------------- --- And when I try the url http://localhost:8080/DBTest/test.jsp I am getting the following errors description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:758) org.apache.jsp.test_jsp._jspService(test_jsp.java:82) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 24) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unk nown Source) org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknow n Source) org.apache.jsp.test_jsp._jspx_meth_sql_query_0(test_jsp.java:101) org.apache.jsp.test_jsp._jspService(test_jsp.java:58) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 24) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802 ---------------------------------------------------------------------------- --- My console server display is as follows eb 20, 2005 10:31:08 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Feb 20, 2005 10:31:08 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1422 ms Feb 20, 2005 10:31:09 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Feb 20, 2005 10:31:09 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.28 Feb 20, 2005 10:31:09 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Feb 20, 2005 10:31:10 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Feb 20, 2005 10:31:10 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\admin.xml Feb 20, 2005 10:31:10 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Feb 20, 2005 10:31:10 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Feb 20, 2005 10:31:11 PM org.apache.struts.util.PropertyMessageResources INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true Feb 20, 2005 10:31:13 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\balancer.xml Feb 20, 2005 10:31:14 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\CurrencyConverter.xml Feb 20, 2005 10:31:14 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\expressionLanguage.xml Feb 20, 2005 10:31:14 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\Fin46.xml Feb 20, 2005 10:31:14 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\Fupload.xml Feb 20, 2005 10:31:15 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\Hangman.xml Feb 20, 2005 10:31:15 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\helloworld.xml Feb 20, 2005 10:31:15 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\Interactivehelloworld. xml Feb 20, 2005 10:31:15 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\jstltest.xml Feb 20, 2005 10:31:15 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\manager.xml Feb 20, 2005 10:31:15 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\ServletExamples.xml Feb 20, 2005 10:31:15 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-5.0.28\conf\Catalina\localhost\store.xml Feb 20, 2005 10:31:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /sample from URL file:C:/jakarta-tomcat-5.0.28/webapps/sample Feb 20, 2005 10:31:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /jsp-examples from URL file:C:\jakarta-tomcat-5.0.28\webapps\jsp-examples Feb 20, 2005 10:31:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path from URL file:C:\jakarta-tomcat-5.0.28\webapps\ROOT Feb 20, 2005 10:31:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /servlets-examples from URL file:C:\jakarta-tomcat-5.0.28\webapps\servlets-examples Feb 20, 2005 10:31:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /tomcat-docs from URL file:C:\jakarta-tomcat-5.0.28\webapps\tomcat-docs Feb 20, 2005 10:31:17 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /webdav from URL file:C:\jakarta-tomcat-5.0.28\webapps\webdav Feb 20, 2005 10:31:17 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Feb 20, 2005 10:31:17 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Feb 20, 2005 10:31:17 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=10/40 config=C:\jakarta-tomcat-5.0.28\conf\jk2.properties Feb 20, 2005 10:31:17 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 8835 ms __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com http://www.patni.com World-Wide Partnerships. World-Class Solutions. _____________________________________________________________________ This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@patni.com and delete this mail. _____________________________________________________________________ ------=_NextPart_000_003E_01C51906.CE9274D0 Content-Type: text/xml; name="server.xml" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="server.xml" factory org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf/tomcat-users.xml =09 =20 =20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20 =20 factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:thin:PSWTOSHIBA@pc-p4254:1521:PKGSFT username pswtoshiba password pswtoshiba maxActive 50 maxIdle 10 maxWait 30000 removeAbandoned true removeAbandonedTimeout 300 logAbandoned true ------=_NextPart_000_003E_01C51906.CE9274D0 Content-Type: text/plain; name="Readme.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Readme.txt" Settings for Tomcat Connection Pool *************************************** 1) Put classes12.jar file in path =3D> CATALINA_HOME\common\lib 2) Add the Tag given below into server.xml file =20 factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:thin:PSWTOSHIBA@pc-p4254:1521:PKGSFT username pswtoshiba password pswtoshiba maxActive 50 maxIdle 10 maxWait 30000 removeAbandoned true removeAbandonedTimeout 300 logAbandoned true 3) Change the values of url, username, password as per the environment setu= p at Toshiba side. 4) Significance of following tags: maxActive : Maximum number of dB connections in pool. Make sure the max_con= nections of DB are large enough to handle this limit. Set to 0 for no limit. maxIdle : Maximum number of idle dB connections to retain in pool. Set to 0= for no limit. maxWait : Maximum time to wait for a dB connection to become available in m= s, in this example 10 seconds. An Exception is thrown if this timeout is ex= ceeded. Set to -1 to wait indefinitely. removeAbandoned : Abandoned dB connections are removed and recycled based o= n this paramater to the ResourceParams configuration for the DBCP DataSourc= e Resource. removeAbandonedTimeout : Sets the number of seconds a dB connection is left= idle before it is considered abandoned.=20 logAbandoned : The logAbandoned parameter can be set to true if you want DB= CP to log a stack trace of the code which abandoned the dB connection resou= rces.=20 5) Add the following tag in web.xml to ensure default session timeout. 5 Value specified is the minutes after which session timeout would occur. ------=_NextPart_000_003E_01C51906.CE9274D0 Content-Type: text/xml; name="web.xml" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="web.xml" jp.co.toshiba.RDC.PSW.common.PSWSessionListener =09 PSWUserAuthServlet PSWUserAuthServlet jp.co.toshiba.RDC.PSW.common.PSWUserAuthServlet driver oracle.jdbc.driver.OracleDriver =20=20=20=20=20=20 url jdbc:oracle:thin:@pc-p4254:1521:PKGSFT =20=20=20=20=20=20 DBuser pswtoshiba =20=20=20=20=20=20 DBpassword pswtoshiba =20=20=20=20=20=20 initial_increment 1 =20=20=20=20=20=20 increment 1 =20=20=20=20=20=20 sessiontimeout 300 =20=20=20=20=20=20 PSWCSVServlet PSWCSVServlet jp.co.toshiba.RDC.PSW.common.PSWCSVServlet PSWLogoutServlet PSWLogoutServlet jp.co.toshiba.RDC.PSW.common.PSWLogoutServlet PSWUserAuthServlet /servlet/PSWUserAuthServlet PSWCSVServlet /servlet/PSWCSVServlet PSWLogoutServlet /servlet/PSWLogoutServlet 5 ------=_NextPart_000_003E_01C51906.CE9274D0 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org ------=_NextPart_000_003E_01C51906.CE9274D0--