在hibernte4以后如果dataSource是hibernate.hbm.xml配置的话,就会出现这样的情况, Cannot unwrap to requested type [javax.sql.DataSource] 此时需要在srping配置文件中配置dataSource。