LINUX下TOMCAT連接MYSQL報錯﹐尋求大家的幫助?

summergood 2006-03-23 03:38:36
當打開的頁面要連接獲取MYSQL中的數據時報錯.

錯誤發生: java.sql.SQLException: Server connection failure during transaction. Due to underlying exception: 'java.net.SocketException: java.net.NoRouteToHostException: No route to host'. ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.NoRouteToHostException: No route to host STACKTRACE: java.net.SocketException: java.net.NoRouteToHostException: No route to host 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.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:83) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:184) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:722) at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:117) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:108) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at org.apache.struts.util.GenericDataSource.getConnection(GenericDataSource.java:276) at com.ac.dao.Trm1dDAO.list(Trm1dDAO.java:153) at com.ac.controller.Pfm2dAction.List(Pfm2dAction.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1058) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:451) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:312) at fr.improve.struts.taglib.layout.workflow.LayoutRequestProcessor.processForwardConfig(Unknown Source) at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.ac.util.EncodingFilter.doFilter(EncodingFilter.java:39) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:534) ** END NESTED EXCEPTION ** Attempted reconnect 3 times. Giving up.
...全文
218 点赞 收藏 14
写回复
14 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
shenpipi 2006-03-30
楼主,你先试试能不能ping通数据库服务器那台机器吧.
'java.net.SocketException: java.net.NoRouteToHostException: No route to host'
你先看看网络通不通吧,明显是找不到到数据库服务器机器的路由啊.
如果网络通,可以telnet一下mysql的端口.
如果能连接,使用mysql的客户端试一下.
如果能连接,换jdbc驱动.
回复
summergood 2006-03-30
up
回复
shenpipi 2006-03-29
hehe,有可能从windows下面能访问那台linux服务器,而从另一个linux下面不行啊
回复
summergood 2006-03-29
但是我如果把 TOMCAT放在 windows 下運行程序就可以﹐放在linux下就不行﹐ mysql指的都是同一台 linux 服務器
回复
wangx1949 2006-03-29
mysql有没有启动?
回复
shenpipi 2006-03-29
'java.net.SocketException: java.net.NoRouteToHostException: No route to host'
你先看看网络通不通吧,明显是找不到到数据库服务器机器的路由啊.
回复
summergood 2006-03-29
up........
回复
summergood 2006-03-29
不會吧﹐ java 和 mysql 都支持 linux 啊
回复
summergood 2006-03-27
高手呢﹖ 都哪兒去了﹐給點建議啊
回复
summergood 2006-03-24
up,,,,,,
回复
summergood 2006-03-24
up..................................................
回复
RedSunMan 2006-03-24
建議換個 連接數據庫的 JAR包 試試
回复
summergood 2006-03-23
up....
回复
Net8Java 2006-03-23
Trm1dDAO.list(Trm1dDAO.java:153) at
Trm1dDAO类,153行,检查一下
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2006-03-23 03:38
社区公告
暂无公告