项目启动报错

来源:3-6 dao层开发

慕前端1303781

2018-03-08 21:11

2018-03-08 21:09:20.334 ERROR 7784 --- [           main] o.s.boot.SpringApplication               : Application startup failed


java.lang.IllegalArgumentException: At least one base package must be specified

at org.springframework.util.Assert.notEmpty(Assert.java:228) ~[spring-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:269) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.mybatis.spring.mapper.ClassPathMapperScanner.doScan(ClassPathMapperScanner.java:163) ~[mybatis-spring-1.3.1.jar:1.3.1]

at org.mybatis.spring.annotation.MapperScannerRegistrar.registerBeanDefinitions(MapperScannerRegistrar.java:104) ~[mybatis-spring-1.3.1.jar:1.3.1]

at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:359) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]

at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE]

at com.example.demo.FirstSBdemoApplication.main(FirstSBdemoApplication.java:10) [classes/:na]


写回答 关注

3回答

  • 翔仔
    2018-03-09 10:47:24

    同学请与原正确的项目比对一下

    https://gitee.com/xiangze/areadisplay
    https://gitee.com/xiangze/demo

  • qq_小丑_134
    2018-06-03 15:41:54

    你好,我估计你的报错是因为没有添加局域性的@Mapper或者是全局性的@MapperScan.两者选其中之一就可以了.我只是猜测,根据自己的项目进行判断

  • Zhou丶Code_
    2018-05-21 11:13:44

    我也是报这个问题  

    qq_小丑_...

    你好,我估计你的报错是因为没有添加局域性的@Mapper或者是全局性的@MapperScan.两者选其中之一就可以了.我只是猜测,根据自己的项目进行判断

    2018-06-03 15:42:19

    共 1 条回复 >

SpringBoot+MyBatis搭建迷你小程序

SpringBoot+MyBatis搭建小程序后台

91497 学习 · 621 问题

查看课程

相似问题