spring整合hibernate时Tomcat出错

spring整合hibernate启动Tomcat服务器时,控制台显示出错,大概内容如下:
Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception;
哪位大神帮忙解决以下,非常感谢。。。

那你要先去了解Spring集成hibernate 添加映射文件 有哪些方式,加载实体类的配置文件主要有4种方式:mappingResources,mappingLocations、mappingDirectoryLocations与mappingJarLocations
1. :就是你说的要列出每个具体的hbm.xml文件,这种方式对于映射文件不多时还好,当配置文件变得越来越多,阅读和修改起来也越来越麻烦了;
2. 这种方式只要指出映射文件所在文件夹就可以了,Spring会替你找出该文件夹内所有的映射文件,比如:


mypackage/mappings


3. :这种方式也可以指定任何文件路径,并且可以指定前缀:classpath、file等,也可以用通配符指定,'*'指定一个文件(路径)名,'**'指定多个文件(路径)名,如: 这应该就是你说的形式了;
4..mappingJarLocations:这种方式就是指定加载的映射文件在jar文件,这个你可以自己试下;

检查下你的bean是否配置了ID,或者把你的applicationContext.xml 配置文件贴出来

图片说明

你去看看你用的hibernate的jar包是哪个版本的,看看和你用的hibernate3是否对应

dataSource设置属性user改成=》username,然后在看看问题。