Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 55658 invoked from network); 12 Jul 2007 10:00:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jul 2007 10:00:06 -0000 Received: (qmail 88633 invoked by uid 500); 12 Jul 2007 09:59:53 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 88612 invoked by uid 500); 12 Jul 2007 09:59:53 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 88601 invoked by uid 99); 12 Jul 2007 09:59:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2007 02:59:53 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: 24.24.2.56 is neither permitted nor denied by domain of dns4@cornell.edu) Received: from [24.24.2.56] (HELO ms-smtp-02.nyroc.rr.com) (24.24.2.56) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2007 02:59:49 -0700 Received: from [192.168.5.102] (cpe-24-59-111-127.twcny.res.rr.com [24.59.111.127]) by ms-smtp-02.nyroc.rr.com (8.13.6/8.13.6) with ESMTP id l6C9xRxP000937 for ; Thu, 12 Jul 2007 05:59:27 -0400 (EDT) Message-ID: <4695FB7F.30903@cornell.edu> Date: Thu, 12 Jul 2007 05:59:27 -0400 From: David Smith User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: problem with Tomcat 5.5.17, Axis 2, MySQL 3.1.12, JNDI References: <18db8b110707111543x4a7b4b14l4ee03285f6d9409f@mail.gmail.com> In-Reply-To: <18db8b110707111543x4a7b4b14l4ee03285f6d9409f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Checked: Checked by ClamAV on apache.org I'd recommend dropping the context definition in your server.xml. Under normal conditions you should never have to modify that file except to alter server-wide settings like which ports it listens on. Also looking at your axis2/META-INF/context.xml file, I see the port number is incorrect. Lastly, I would recommend you drop the autoReconnect parameter of your database url and add validationQuery="select 1" to your Resource element. Autoreconnect is of minimal usefullness and validationQuery can test the db connection before your app attemps to use it. --David albert quinn wrote: > Hi ! : > > First of all : excuse my poor english. Second : I'm trying to set up > a MySQL connection pool on Tomcat 5.5.17 (running over Windows XP) to > connect to a remote DB from a web service running on the Axis 2 > deployed in Tomcat. I've read the Tomcat docs and the Tomcat mailing > lists but i've not founded any answers that help me to fix the > problem. I've this in my "conf\server.xml" : > > > ..... > reloadable="true"> > > name="java:comp/env/jdbc/DB" password="mypassword" > type="javax.sql.DataSource" > url="jdbc:mysql://remoteaddress.com:3306/db?autoReconnect=true" > username="myname"/> > > > > > .... > > > I've this "C:\Archivos de programa\Apache Software Foundation\Tomcat > 5.5\webapps\axis2\META-INF\context.xml " file : > > > > > WEB-INF/web.xml > > name="jdbc/DB" password="mypassword" type="javax.sql.DataSource" > url="jdbc:mysql://remoteaddress.com:3036/db?autoReconnect=true" > username="myname"/> > > > > I've these lines in "C:\Archivos de programa\Apache Software > Foundation\Tomcat 5.5\webapps\axis2\WEB-INF\web.xml" > > > > a description > > > jdbc/DB > > > javax.sql.DataSource > > > Container > > > > When i call the web service running on Axis 2, after a long time i > get the next Exception message : > > Cannot create PoolableConnectionFactory (Server connection failure > during transaction. Due to underlying exception: > 'java.net.SocketException: java.net.NoRouteToHostException: No route > to host: connect'. > > ** BEGIN NESTED EXCEPTION ** > > java.net.SocketException > MESSAGE: java.net.NoRouteToHostException: No route to host: connect > > STACKTRACE: > > java.net.SocketException: java.net.NoRouteToHostException: No route to > host: connect > > at > com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) > > > at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284) > > at com.mysql.jdbc.Connection.createNewIO(Connection.java :2680) > > at com.mysql.jdbc.Connection.(Connection.java:1485) > > at > com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) > > > at > org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection > (DriverConnectionFactory.java:37) > > at > org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) > > > at > org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory > (BasicDataSource.java:877) > > at > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) > > > at > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) > > > at code.prueba.PruebaBD.getUserLogin(PruebaBD.java:20) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > > at java.lang.reflect.Method.invoke(Unknown Source) > > at > org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java > > :91) > > at > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39) > > > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144) > > at > org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:122) > > > at > org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:116) > > > at > org.apache.axis2.transport.http.AxisServlet$ProcessRESTRequest.processURLRequest > > (AxisServlet.java:776) > > at > org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:238) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > > at javax.servlet.http.HttpServlet.service (HttpServlet.java:802) > > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > > > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java > > :173) > > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > > > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) > > > at org.apache.catalina.core.StandardHostValve.invoke > (StandardHostValve.java:126) > > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > > > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) > > > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > > > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) > > > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection > > (Http11BaseProtocol.java:664) > > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) > > > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java > > :80) > > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) > > > at java.lang.Thread.run(Unknown Source) > > > > ** END NESTED EXCEPTION ** > > > Attempted reconnect 3 times. Giving up.) > > > I've tried to turn it off the FireWall, but i've got the same > Exception message. The lines in the web service are : > > > Context oContext = new InitialContext(); > DataSource oDataSource = (DataSource) > oContext.lookup("java:comp/env/jdbc/DB"); > Connection oConnection = oDataSource.getConnection(); > > I've tried to modify the web service to connect to the DB using the > JDBC Driver directly with : > > > Class jdbcDriverClass = Class.forName( > "com.mysql.jdbc.Driver" ); > Driver oDriver = (Driver) jdbcDriverClass.newInstance(); > DriverManager.registerDriver(oDriver); > Connection oConnection = > DriverManager.getConnection("jdbc:mysql://remoteaddress.com:3306/db","myname","mypassword"); > > > That way i can connect to the remote database without problems. Of > course i've the mysql jar in the Tomcat's "common\lib" directory. But > after many hours of reading and trying and knocking on heaven's door > (hard, with the head!! ;) i've no idea of what is happening, even > worse... i've no idea of what to do to find the problem. Does anybody > have any idea to help me to discover where is the problem? Many thanks > to anybody who help!!!! > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org