【问题标题】:Error during Hibernate connection休眠连接期间出错
【发布时间】:2014-06-12 01:03:44
【问题描述】:

Struts 问题报告

Struts has detected an unhandled exception:
Messages:   
Error! Please, check your JDBC/JDNI Configurations and Database Server avaliability. Could not open or put a Hibernate Session in ValueStack: JDBC Driver class not found: com.mysql.jdbc.driver
File:   com/googlecode/s2hibernate/struts2/plugin/interceptors/SessionTransactionInjectorInterceptor.java
Line number:    134
JDBC Driver class not found: com.mysql.jdbc.driver

我已将 MySQL jar 保存在 lib 中并检查了 ref lib 都正确请建议我解决此问题我正在尝试通过 Hibernate 注释连接 db

堆栈跟踪

org.hibernate.SessionException: Error! Please, check your JDBC/JDNI Configurations and Database Server avaliability. Could not open or put a Hibernate Session in ValueStack: JDBC Driver class not found: com.mysql.jdbc.driver

【问题讨论】:

  • 我在 lib 中添加了 mysql jar 并拥有所有引用的类
  • 请发布您的 hibernate.cfg.xml 文件。

标签: java mysql hibernate jdbc struts2


【解决方案1】:

您配置了错误的驱动程序类。正确的类名com.mysql.jdbc.Driver。参见here的用法示例。

【讨论】:

  • 谢谢先生,同样的问题我们当天就解决了
猜你喜欢
  • 2014-05-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-02-02
  • 2016-07-15
  • 2011-01-05
相关资源
最近更新 更多