gpt4 book ai didi

mysql - Linux Mandriva : Tomcat can not get MySQL database connection, 为什么?

转载 作者:太空狗 更新时间:2023-10-29 12:35:26 27 4
gpt4 key购买 nike

我在Linux Mandriva上安装了Tomcat 7MySQL数据库,但是部署在容器中的应用无法连接。

我写了两个简单的测试,当从客户端运行它们时,我得到了连接 -

public class TestHibernate {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
User user = new User();
user.setName("userName");
user.setPassword("userPassword");

Session session = HibernateUtil.
getSessionFactory().openSession();

session.beginTransaction();
session.save(user);
session.getTransaction().commit();

session.close();
}
}

HibernateUtil 的一部分 -

...
cnf.setProperty("hibernate.connection.url", "jdbc:mysql://ip:3306/gibrid");
cnf.setProperty("hibernate.connection.username", "java");
cnf.setProperty("hibernate.connection.password", "java");
...

Jdbc 测试-

public class TestJdbc {
public static void main(String[] args) {
Connection conn = null;
String url = "jdbc:mysql://ip:3306/";
String dbName = "gibrid";
String driver = "com.mysql.jdbc.Driver";
String userName = "java";
String password = "java";
try {
Class.forName(driver).newInstance();
conn = DriverManager.getConnection(url+dbName,userName,password);
System.out.println("Connected to the database");
conn.close();
System.out.println("Disconnected from database");
} catch (Exception e) {
e.printStackTrace();
}
}
}

在这些情况下,我可以获得连接并可以使用数据库。但是当我从客户端浏览器请求时,我会超时。这是为什么?如果能提供信息,我将不胜感激。


这是 catalina.out -

...
INFO: Server startup in 5315 ms
17.10.2012 15:36:52 com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN
INFO: Requested resource [VAADIN/themes/web13theme/favicon.ico] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
17.10.2012 15:36:58 com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN
INFO: Requested resource [VAADIN/themes/projtheme/img/cancel.png] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
3 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.4.0.GA
25 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - Hibernate 3.3.0.SP1
39 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - hibernate.properties not found
44 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
50 [http-bio-8081-exec-7] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
148 [http-bio-8081-exec-7] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.1.0.GA
176 [http-bio-8081-exec-7] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
247 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.Incoming
313 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.Incoming on table INCOMING
397 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.Outcoming
397 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.Outcoming on table OUTCOMING
400 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.User
400 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.User on table USER
402 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.ssi.domen.Cable
402 [http-bio-8081-exec-7] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.ssi.domen.Cable on table CABLE
497 [http-bio-8081-exec-7] INFO org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring
509 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
510 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
510 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
514 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://---ip here----/gibrid
514 [http-bio-8081-exec-7] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=java, password=****}
189691 [http-bio-8081-exec-7] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.ConnectException
MESSAGE: Connection timed out

STACKTRACE:

java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:218)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.ssi.hbnutils.HibernateUtil.<clinit>(HibernateUtil.java:34)
at com.ssi.windows.RegWindow.check(RegWindow.java:167)
at com.ssi.windows.RegWindow.insert(RegWindow.java:140)
at com.ssi.windows.RegWindow.access$0(RegWindow.java:139)
at com.ssi.windows.RegWindow$1.buttonClick(RegWindow.java:107)
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:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:567)
at com.vaadin.ui.Button.changeVariables(Button.java:223)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:323)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)


** END NESTED EXCEPTION **



Last packet sent to the server was 6 ms ago.
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2847)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.ssi.hbnutils.HibernateUtil.<clinit>(HibernateUtil.java:34)
at com.ssi.windows.RegWindow.check(RegWindow.java:167)
at com.ssi.windows.RegWindow.insert(RegWindow.java:140)
at com.ssi.windows.RegWindow.access$0(RegWindow.java:139)
at com.ssi.windows.RegWindow$1.buttonClick(RegWindow.java:107)
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:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:567)
at com.vaadin.ui.Button.changeVariables(Button.java:223)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:323)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
190005 [http-bio-8081-exec-7] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
190066 [http-bio-8081-exec-7] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
190090 [http-bio-8081-exec-7] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
190092 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
190092 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
190114 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: disabled
190115 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
190116 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
190125 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
190127 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
190127 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
190128 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
190128 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
190129 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
190167 [http-bio-8081-exec-7] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
190169 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
190169 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
190170 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
190171 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
190171 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
190173 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
190174 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
190239 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
190250 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
190250 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
190260 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
190260 [http-bio-8081-exec-7] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
190761 [http-bio-8081-exec-7] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
191112 [http-bio-8081-exec-7] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
380252 [http-bio-8081-exec-7] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01
380252 [http-bio-8081-exec-7] ERROR org.hibernate.util.JDBCExceptionReporter - Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.ConnectException
MESSAGE: Connection timed out

STACKTRACE:

java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:218)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
at com.ssi.windows.RegWindow.check(RegWindow.java:168)
at com.ssi.windows.RegWindow.insert(RegWindow.java:140)
at com.ssi.windows.RegWindow.access$0(RegWindow.java:139)
at com.ssi.windows.RegWindow$1.buttonClick(RegWindow.java:107)
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:597)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Button.fireClick(Button.java:567)
at com.vaadin.ui.Button.changeVariables(Button.java:223)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:323)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)


** END NESTED EXCEPTION **



Last packet sent to the server was 5 ms ago.

最佳答案

我不熟悉 Hibernate,所以我不知道这是否相关:

“未找到 hibernate.properties”

“在 URL 上使用驱动程序:com.mysql.jdbc.Driver:jdbc:mysql://---ip here----/gibrid”

IP 端口是否与您测试程序中的相同?

blog提示 C3PO 的配置问题。一条评论暗示了 Mysql 和 C3PO 之间不同的超时设置。

关于mysql - Linux Mandriva : Tomcat can not get MySQL database connection, 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12934384/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com