springboot项目:扫描不到其他模块的包 Parameter 0 of constructor in com.zjxf.repository.UserRepository

摘要:
报错信息如下:***************************APPLICATIONFAILEDTOSTART***************************Description:Parameter0ofconstructorincom.zjxf.repository.UserRepositoryrequiredabeanoftype'java.lang.String'thatcou
报错信息如下:



***************************

APPLICATION FAILED TO START
***************************


Description:
Parameter 0 of constructor in com.zjxf.repository.UserRepository required a bean of type 'java.lang.String' that could not be found.

Action:
Consider defining a bean of type 'java.lang.String' in your configuration.

疑问:springboot怎么扫描其他模块的bean

解决:
找不到哪的包就把路径写一下就行.这里是com.zjxf.repository.UserRepository这个找不到.
@ComponentScan(basePackages = {"com.zjxf.repository"})

/**
 * 票查保 运营平台启动类
 *
 * @author WeiQiang
 * @date 2020/9/17 9:31
 */
@EnableSwagger2
@ServletComponentScan
@EnableCaching
@EnableScheduling
@ComponentScan(basePackages = {"com.zjxf.repository"})
@SpringBootApplication(exclude = {RedisRepositoriesAutoConfiguration.class, MongoRepositoriesAutoConfiguration.class})
public class PcbManageApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(PcbManageApplication.class);
        springApplication.addListeners(new ApplicationStartup());
        springApplication.run(args);
    }

}

免责声明:文章转载自《springboot项目:扫描不到其他模块的包 Parameter 0 of constructor in com.zjxf.repository.UserRepository》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇高通LCD开发常见问题&分析获取用户当前位置信息的两种方法——H5、微信下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

SpringBoot项目启动报错解决记录

2020-06-29 11:14:37,181 - [WARN] o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt:...

Spring注解@Component、@Repository、@Service、@Controller @Resource、@Autowired、@Qualifier、@scope

以下内容摘自部分网友的,并加上了自己的理解 @Service用于标注业务层组件(我们通常定义的service层就用这个) @Controller用于标注控制层组件(如struts中的action、Spring MVC中的Controller) @Repository用于标注数据访问组件,即DAO组件 @Component泛指组件,当组件不好归类的时候,我们...

项目启动时报错Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError

报错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectMapperConfigurer' defined in class path resource [springfox/documentation/spring/...

spring + redis 实现数据的缓存

1、实现目标   通过redis缓存数据。(目的不是加快查询的速度,而是减少数据库的负担)   2、所需jar包      注意:jdies和commons-pool两个jar的版本是有对应关系的,注意引入jar包是要配对使用,否则将会报错。因为commons-pooljar的目录根据版本的变化,目录结构会变。前面的版本是org.apache.pool,而...

spring自动注入的三种方式

所谓spring自动注入,是指容器中的一个组件中需要用到另一个组件(例如聚合关系)时,依靠spring容器创建对象,而不是手动创建,主要有三种方式: 1. @Autowired注解——由spring提供 2. @Resource注解——由JSR-250提供 3. @Inject注解——由JSR-330提供   @Autowired注解的使用方法 @Tar...

解读eXtremeComponents代码结构--转载

原文地址:http://blog.csdn.net/lark3/article/details/1937466 大致整理了去年写的东西,罗列如下: ec是一系列提供高级显示的开源JSP定制标签,当前的包含的组件为eXtremeTable,用于以表形式显示数据。ec现在的版本是1.0.1,由Jeff Johnston开发的,网址:http://www.ex...