Re: struts failed connection to remote mySQL

From: Sudsy (bitbucket44_at_hotmail.com)
Date: 08/14/04

  • Next message: PC Leung: "Re: How to expire a web page and disable the refresh button?"
    Date: Fri, 13 Aug 2004 20:28:27 -0400
    
    

    David wrote:
    <snip>
    > Here is my jdbc connection info:
    > <data-source key="musiccollection"
    > type="org.apache.commons.dbcp.BasicDataSource">
    > <set-property property="description" value="Music Collection
    > Database"/>
    > <set-property property="driverClassName"
    > value="com.mysql.jdbc.Driver"/>
    > <set-property property="username" value="sqluser"/>
    > <set-property property="password" value="sqluser"/>
    > <set-property property="url"
    > value="jdbc:mysql://192.168.0.1:3306/musiccollection?autoReconnect=true"/>
    > <set-property property="maxCount" value="8"/>
    > <set-property property="minCount" value="2"/>
    > </data-source>
    >
    >
    > When I try to startup my struts app I get the following error:
    >
    > INFO: Initializing, config='ApplicationResources', returnNull=true
    > Aug 13, 2004 4:49:18 PM org.apache.struts.action.ActionServlet
    > initModuleDataSources
    > SEVERE: Initializing application data source musiccollection
    > org.apache.commons.dbcp.SQLNestedException: Cannot create
    > PoolableConnectionFactory (Unable to connect to any hosts due to
    > exception: java.net.ConnectException: Operation timed out
    <snip>

    Looks like mysql isn't listening. On the RedHat server type the
    following command:
         netstat -a | grep 3306
    If you don't see a line somthing like this:
         tcp 0 0 *:3306 *:* LISTEN
    then you don't have a listener. Also run the following command:
         ifconfig eth0
    It should show an IP address of 192.168.0.1 if your parameters
    are to be believed.


  • Next message: PC Leung: "Re: How to expire a web page and disable the refresh button?"