Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
JSP - A mailing list about Java Server Pages specification and reference
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Pooling Issue

Pooling Issue

2006-11-18       - By David Smith

 Back
Reply:     1     2     3     4     5     6  

For starters, you might want to make a copy of your server.xml file for
documentation purposes and then drop all the comments from the active
one.  The documentation comments are excellent, but they make the
serverl.xml near impossible to read.

At any rate.... the exception is connection refused.  Are you sure your
MySQL server is listening on port 3306?  Some default configurations use
unix sockets exclusively -- something java JDBC drivers can't do.  Try
this from the same machine your server is on:

mysql -h localhost -P 3306 -u rpd -p

The above command forces mysql client to connect via TCP/IP with userid
rpd and prompt for a password.  If this works, then we're looking at
something else.  If this doesn't, reconfigure your mysql server to
listen on tcp/ip port 3306 and try again.

Some additional recommendations -- not directly related to your issue,
but worth mentioning:

The <Context ...> ... </Context> block should be in it's own xml file
under conf/Catalina/localhost, named to match the context of your webapp
-- DBTest.xml in your case.  Avoid setting this in server.xml as it
requires restarting the tomcat container every time you want to make a
change to your webapp's config.

Drop the autoReconnect=true from your database url.  It isn't
recommended by MySQL and doesn't make sense in a database connection
pool anyway.

--David

tyju tiui wrote:
> I'm having problems setting up connection pooling with
> comcat 5.5.2.0 and MySQL 5.0.24 using mysql
> connector/J 5.0.
>
> I've setup / populated a test database and verified
> that I can login to the server/db using the specified
> username/password/host found in the connection string.
> My server.xml looks like this:
>
>  
 <snipped here .... a lot of irrelevant stuff to the issue at hand. />
>         <!-- ********** Pooling Config ********** -->
>         <Context path="/DBTest" docBase="DBTest"
>                  debug="5" reloadable="true"
> crossContext="true">
>
>
>  
< snipped again...../>
>             <Resource name="jdbc/TestDB"
>                       auth="Container"
>                       type="javax.sql.DataSource Source code of javax.sql.DataSource"
>                      
> factory="org.apache.commons.dbcp.BasicDataSourceFactory Source code of org.apache.commons.dbcp.BasicDataSourceFactory"
>                       maxActive="100"
>                       username="rpd"
>                       password="2wERk4rpd"
>                       maxIdle="30"
>                       maxWait="10000"
>                      
> driverClassName="com.mysql.jdbc.Driver Source code of com.mysql.jdbc.Driver"
>                       removeAbandoned="true"
>                      
> url="jdbc:mysql://localhost:3306/phptest?autoReconnect=true"
>                       />
>
>         </Context>
>         <!-- ********** End Pooling ********** -->
>
>       </Host>
>
>     </Engine>
>
>   </Service>
>
> </Server>
>
>
>
>
>
>
>
> I'm using the sample web.xml and test.jsp found at:
> http://tomcat.apache.org/tomcat-5 (See http://cat-5.ora-code.com).0-doc/jndi-datasource-examples-howto.html
>
>
>
>
>
>
> There error I'm getting is:
>
> org.apache.jasper.JasperException Source code of org.apache.jasper.JasperException: Unable to get
> connection, DataSource invalid:
> "org.apache.commons.dbcp.SQLNestedException Source code of org.apache.commons.dbcp.SQLNestedException: Cannot
> create PoolableConnectionFactory (Server connection
> failure during transaction. Due to underlying
> exception: 'java.net.SocketException Source code of java.net.SocketException:
> java.net.ConnectException Source code of java.net.ConnectException: Connection refused'.
>
> ** BEGIN NESTED EXCEPTION **
>
> java.net.SocketException Source code of java.net.SocketException
> MESSAGE: java.net.ConnectException Source code of java.net.ConnectException: Connection refused
>
> STACKTRACE:
>
> java.net.SocketException Source code of java.net.SocketException: java.net.ConnectException Source code of java.net.ConnectException:
> Connection refused
>   at
> com.mysql.jdbc.StandardSocketFactory Source code of com.mysql.jdbc.StandardSocketFactory(StandardSocketFactory.java:156)
>   at com.mysql.jdbc.MysqlIO Source code of com.mysql.jdbc.MysqlIO<init>(MysqlIO.java:276)
>   at
> com.mysql.jdbc.Connection Source code of com.mysql.jdbc.Connection(Connection.java:2815)
>   at
> com.mysql.jdbc.Connection Source code of com.mysql.jdbc.Connection<init>(Connection.java:1531)
>   at
> com.mysql.jdbc.NonRegisteringDriver Source code of com.mysql.jdbc.NonRegisteringDriver(NonRegisteringDriver.java:266)
>   at
> org.apache.commons.dbcp.DriverConnectionFactory Source code of org.apache.commons.dbcp.DriverConnectionFactory
(DriverConnectionFactory.java:37)
>   at
> org.apache.commons.dbcp.PoolableConnectionFactory Source code of org.apache.commons.dbcp.PoolableConnectionFactory
(PoolableConnectionFactory.java:290)
>   at
> org.apache.commons.dbcp.BasicDataSource Source code of org.apache.commons.dbcp.BasicDataSource
(BasicDataSource.java:877)
>   at
> org.apache.commons.dbcp.BasicDataSource Source code of org.apache.commons.dbcp.BasicDataSource(BasicDataSource.java
:851)
>   at
> org.apache.commons.dbcp.BasicDataSource Source code of org.apache.commons.dbcp.BasicDataSource(BasicDataSource.java
:540)
>   at
> org.apache.taglibs.standard.tag.common.sql.QueryTagSupport Source code of org.apache.taglibs.standard.tag.common.sql.QueryTagSupport
(Unknown
> Source)
>   at
> org.apache.taglibs.standard.tag.common.sql.QueryTagSupport Source code of org.apache.taglibs.standard.tag.common.sql.QueryTagSupport(Unknown
> Source)
>   at
> org.apache.jsp.test_jsp._jspx_meth_sql_query_0(test_jsp.java:100)
>   at
> org.apache.jsp.test_jsp._jspService(test_jsp.java:58)
>   at
> org.apache.jasper.runtime.HttpJspBase Source code of org.apache.jasper.runtime.HttpJspBase(HttpJspBase.java:97)
>   at
> javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:802)
>   at
> org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper.java
:334)
>   at
> org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:314)
>   at
> org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:264)
>   at
> javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:802)
>   at
> org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:252)
>   at
> org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:173)
>   at
> org.apache.catalina.core.StandardWrapperValve Source code of org.apache.catalina.core.StandardWrapperValve(StandardWrapperValve
.java:213)
>   at
> org.apache.catalina.core.StandardContextValve Source code of org.apache.catalina.core.StandardContextValve(StandardContextValve
.java:178)
>   at
> org.apache.catalina.core.StandardHostValve Source code of org.apache.catalina.core.StandardHostValve(StandardHostValve.java:126)
>   at
> org.apache.catalina.valves.ErrorReportValve Source code of org.apache.catalina.valves.ErrorReportValve(ErrorReportValve.java:105)
>   at
> org.apache.catalina.core.StandardEngineValve Source code of org.apache.catalina.core.StandardEngineValve(StandardEngineValve.java
:107)
>   at
> org.apache.catalina.connector.CoyoteAdapter Source code of org.apache.catalina.connector.CoyoteAdapter(CoyoteAdapter.java:148)
>   at
> org.apache.coyote.http11.Http11Processor Source code of org.apache.coyote.http11.Http11Processor(Http11Processor.java:869)
>   at
> org.apache.coyote.http11.Http11BaseProtocol Source code of org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler
.processConnection(Http11BaseProtocol.java:664)
>   at
> org.apache.tomcat.util.net.PoolTcpEndpoint Source code of org.apache.tomcat.util.net.PoolTcpEndpoint(PoolTcpEndpoint.java
:527)
>   at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread Source code of org.apache.tomcat.util.net.LeaderFollowerWorkerThread
(LeaderFollowerWorkerThread.java:80)
>   at
> org.apache.tomcat.util.threads.ThreadPool Source code of org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java
:684)
>   at java.lang.Thread Source code of java.lang.Thread(Thread.java:595)
>
>
> ** END NESTED EXCEPTION **
>
>
> Attempted reconnect 3 times. Giving up.)"
>
> org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper
(JspServletWrapper.java:512)
>
> org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper.java
:377)
>
> org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:314)
>
> org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:264)
>
> javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:802)
>
>
>
>
>
>
>
>
>
>
> Any help would be greatly appreciated.
>
>
>  
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
__ ____
> Sponsored Link
>
> Compare mortgage rates for today.
> Get up to 5 free quotes.
> Www2.nextag.com
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To start a new topic, e-mail: users@(protected)
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>  


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.