RE: Configuring dbcp in / ROOT context (tomcat 5.5.7)
Hi, 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: Stuart Lewis [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 4:16 PM To: tomcat-user@jakarta.apache.org Subject: Configuring dbcp in / ROOT context (tomcat 5.5.7) Hi, I've searched the archives and generally on google, and whilst people see the problem a lot, I've not found a definitive answer for how to configure dbcp in the root context. E.g. In server.xml I have: Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Resource name=jdbc/postgres auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=whatver password=whatver driverClassName=org.postgresql.Driver url=jdbc:postgresql://127.0.0.1:5432/whatever scope=Shareable factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory/ /Context If I copy this, and have it the same, except: Context path=/ docBase=ROOT debug=5 reloadable=true crossContext=true then it fails, with: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' How should I be configuring my postgress connection for use in the root context? Any help will be hugely appreciated, and will stop me from pulling any more of my hair out! Thanks, Stuart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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 [EMAIL PROTECTED] and delete this mail. _ !-- Example Server Configuration File -- !-- Note that component elements are nested corresponding to their parent-child relationships with each other -- !-- A Server is a singleton element that represents the entire JVM, which may contain one or more Service instances. The Server listens for a shutdown command on the indicated port. Note: A Server is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- Server port=8005 shutdown=SHUTDOWN debug=0 !-- Comment these entries out to disable JMX MBeans support -- !-- You may also configure custom components (e.g. Valves/Realms) by including your own mbean-descriptor file(s), and setting the descriptors attribute to point to a ';' seperated list of paths (in the ClassLoader sense) of files to add to the default list. e.g. descriptors=/com/myfirm/mypackage/mbean-descriptor.xml -- Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=0/ !-- Global JNDI resources -- GlobalNamingResources !-- Test entry for demonstration purposes -- Environment name=simpleValue type=java.lang.Integer value=30/ !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams !-- Defining the DataSource to be used for Tomcat connectionPooling -- /GlobalNamingResources !-- A Service is a collection of one or more Connectors that share a single Container (and therefore the web applications visible within that Container). Normally, that Container is an Engine, but this is not required. Note: A Service is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- !-- Define the Tomcat Stand-Alone Service -- Service name=Catalina
Re: JDBC connection - Please help
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:[EMAIL PROTECTED] 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 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 descriptionMySQL Test App/description resource-ref descriptionDB Connection/description res-ref-namejdbc/TestDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app --- In server.xml I have the following context ( trying to connect to Sybase database) Context path=/DBTest docBase=DBTest debug=5 reloadable=true crossContext=true Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.sybase.jdbc2.jdbc.SybDriver url=jdbc:sybase:Tds:re2unx188:2025/ /Context --- 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 % sql:query var=rs dataSource=jdbc/TestDB select id, foo, bar from testdata /sql:query html head titleDB Test/title /head body h2Results/h2 c:forEach var=row items=${rs.rows} Foo ${row.foo}br/ Bar ${row.bar}br/ /c:forEach /body /html --- 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
RE: JDBC connection errors
Hi, Looks like you are using the Tomcat Connection pool. Refer to the attached file and verify that you have done these steps. I think it should solve your problem. -Original Message- From: deepak suldhal [mailto:[EMAIL PROTECTED] Sent: Monday, February 21, 2005 11:43 AM To: tomcat users Subject: JDBC connection errors Hi I am getting the following errors while trying to make a JDBC connection. Please help. 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 __ 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 [EMAIL PROTECTED] and delete this mail. _ Settings for Tomcat Connection Pool *** 1) Put classes12.jar file in path = CATALINA_HOME\common\lib 2) Add the Tag given below into server.xml file DefaultContext Resource name=jdbc/myOracle type=javax.sql.DataSource/ ResourceParams name=jdbc/myOracle parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:[EMAIL PROTECTED]:1521:PKGSFT/value /parameter parameter nameusername/name valuepswtoshiba/value /parameter parameter namepassword/name valuepswtoshiba/value /parameter parameter namemaxActive/name value50/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value3/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value300/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams /DefaultContext 3) Change the values of url, username, password as per the environment setup at Toshiba side. 4) Significance of following tags: maxActive : Maximum number of dB connections in pool. Make sure the max_connections 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
FW: Please help for a query in Tomcat. - Problem : Tomcat gets hanged
-Original Message- From: Reshma Bhatia [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 7:36 PM To: '[EMAIL PROTECTED]' Subject:Please help for a query in Tomcat. - Problem : Tomcat gets hanged Hi, We have designed an application which works in Java JSP - Tomcat - Oracle environment. Our JSP page has two frames. 1). First frame : This is the top frame containing links (displayed as Tabs) 2). Second Frame : This is below the top frame and is updated with the selected link. For each click on the link a request is submitted and the response is populated in the second frame. The second frame contains a search criteria and fetches data from the database. Conditions when Tomcat hangs 1). When we try clicking on the links very fast 2). While the data is being fetched from the database and manipulated and if we click on other the links the server gets hang. Our analysis and understanding is : There would be some threads (requests) whose output was not allowed to be displayed in the second frame due to click on other links which would spawn another request for the same target. These requests remain in "Service" state as understood from the Tomcat-Manager status. Also, as per the information given on the link http://forum.java.sun.com/thread.jspa?threadID=454684messageID=2072194 these requests would "always" remain in Service State. Please confirm whether our understanding is correct. Please provide a solution to this problem? Let us know in case any further information is needed. Thanks and regards, Reshma 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 [EMAIL PROTECTED] and delete this mail. _- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FW: Please help for a query in Tomcat. - Problem : Tomcat gets hanged
Is there a way to kill the Tomcat threads which have gone into infinite loop / hang state. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Friday, February 18, 2005 10:26 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: FW: Please help for a query in Tomcat. - Problem : Tomcat gets hanged You can try modifiying the maxProcessors in the connector element in conf/server.xml to a higher value to test whether increasing no of threads solve the problem. Post Tomcat , Java VM and OS versions. rgds Antony Paul On Fri, 18 Feb 2005 10:14:15 +0530, Reshma Bhatia [EMAIL PROTECTED] wrote: -Original Message- From: Reshma Bhatia [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 7:36 PM To: '[EMAIL PROTECTED]' Subject:Please help for a query in Tomcat. - Problem : Tomcat gets hanged Hi, We have designed an application which works in Java JSP - Tomcat - Oracle environment. Our JSP page has two frames. 1). First frame : This is the top frame containing links (displayed as Tabs) 2). Second Frame : This is below the top frame and is updated with the selected link. For each click on the link a request is submitted and the response is populated in the second frame. The second frame contains a search criteria and fetches data from the database. Conditions when Tomcat hangs 1). When we try clicking on the links very fast 2). While the data is being fetched from the database and manipulated and if we click on other the links the server gets hang. Our analysis and understanding is : There would be some threads (requests) whose output was not allowed to be displayed in the second frame due to click on other links which would spawn another request for the same target. These requests remain in Service state as understood from the Tomcat-Manager status. Also, as per the information given on the link http://forum.java.sun.com/thread.jspa?threadID=454684messageID=2072194 these requests would always remain in Service State. Please confirm whether our understanding is correct. Please provide a solution to this problem? Let us know in case any further information is needed. Thanks and regards, Reshma 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 [EMAIL PROTECTED] and delete this mail. _ - 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] 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 [EMAIL PROTECTED] and delete this mail. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]