你没有配置数据源,请问你是怎么连接数据库的?
下面是我一个项目中的配置 ,只是作为参考 ,请注意要配置数据源:
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" default-autowire="byName">
你好。
如果DAO里没有显示编写setter和getter方法的话,就需要继承Hibernate里的一些类,其中就包括sessionFactory的getter和setter方法。
你在dao有没有写 sessionFactory的 get set 方法?你的spring 配置没有错误,具体报什么错误你没说。我也不清楚怎么解决
我刚接触框架进来看,楼主问问题的话建议到CSDN里问 这边想看你的截图 都很模糊 郁闷
什么错误信息啊,你贴出来看看啥