spring 与 hibernate 整合的错误, 求高手直接。下边是报错信息启动tomcat时的。
org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'ses...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to access java.sql.DatabaseMetaData to determine appropriate Dialect to use
Caused by: org.hibernate.HibernateException: Unable to access java.sql.DatabaseMetaData to determine appropriate Dialect to use
at org.hibernate.dialect.resolver.DialectFactory.determineDialect(DialectFactory.java:140)
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:96)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:117)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134) 展开
Caused by: org.hibernate.HibernateException: Unable to access java.sql.DatabaseMetaData to determine appropriate Dialect to use
at org.hibernate.dialect.resolver.DialectFactory.determineDialect(DialectFactory.java:140)
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:96)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:117)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134) 展开
3个回答
展开全部
应该是配置的数据库信息不正确
1、检查数据库有没有启动
2、检查数据库方言有没有配置
3、检查数据库url、driver、username、password是否正确
1、检查数据库有没有启动
2、检查数据库方言有没有配置
3、检查数据库url、driver、username、password是否正确
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml] 这不告诉的很明白吗 看一下applicationContext.xml文件sessionFactory那块肯定哪块写错了
追问
下边是我注入 sessionFactory 那段 ,我看不出问题
demo/entity/Person.hbm.xml
追答
那你dataSource里边数据库信息配置正确了吗 贴出来看一下
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
注入的地方写错了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询