哪里出错?

来源:3-5 数据访问层搭建—集成Druid连接池

慕函数1054313

2019-04-29

Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled.
2019-04-29 14:31:40.557 ERROR 10268 — [ main] o.s.boot.SpringApplication : Application startup failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userService’: Unsatisfied dependency expressed through field ‘userMapper’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [F:\STS\house\house\target\classes\com\house\house\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘sqlSessionFactory’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSource’ defined in class path resource [com/house/house/config/DruidConfig.class]: Invocation of init method failed; nested exception is java.lang.NullPointerException

写回答

1回答

格鲁

2019-05-01

出现了空指针,druidconfig,确定你引入了mysql的驱动包

0
1
慕函数1054313
好像不是,换个druid版本解决了
2019-05-07
共1条回复

Java从单体到微服务打造房产销售平台

单体开发,SpringCloud微服务改造,架构原理剖析,让你在大型项目中独当一面!

711 学习 · 349 问题

查看课程