SSM框架搭建问题出现了这个问题但是我不太理解出错在哪里

轻烟飘荡 2019-01-22 09:38:29
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'studentDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IUserDao' defined in file [C:\Users\CXC\IdeaProjects\commonframework\target\classes\com\cherry\dao\IUserDao.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext-dao.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext-dao.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'username' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'username' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

出错的是这两个
...全文
194 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
loveljy_19901114 2019-01-23
  • 打赏
  • 举报
回复
com.mchange.v2.c3p0.ComboPooledDataSource 看报错是你的这个类初始化有问题吧,这个类的username属性设错了
bcsflilong 2019-01-23
  • 打赏
  • 举报
回复
Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'username' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'username' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
bcsflilong 2019-01-23
  • 打赏
  • 举报
回复
应该是配置文件写错了

com.mchange.v2.c3p0.ComboPooledDataSource

应该用user 不是username

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧