• Spring异常总结


    1.  Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.ha.service.UserService] found for dependency [com.imut.service.IUserService]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

      问题:bean自动注入失败了,

      解决办法:检查提示的类是否增加了@Service、@Component等注解,以及启动类或配置文件的扫描包路径,是否包含了这个类的路径。

    2.  [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectMapperConfigurer' defined in class path resource [springfox/documentation/spring/web/SpringfoxWebMvcConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metaDataSourceAdvisor': Cannot resolve reference to bean 'methodSecurityMetadataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration': BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error Type referred to is not an annotation type: com$zh$system$annotation$11$Log

      问题:出现这个问题的愿意我的项目代码整个结构做了调整,Log类是一个注解类,使用AOP对使用此注解的方法打记录日志。出现这个错的原因就是AOP方法没有找到注解类造成的。这种错误idea或者maven编译时都不会报的。

      解决:在@Aspect类里把注解类路径改对就好了。

  • 相关阅读:
    第二十六篇 -- wifi学习
    第三篇 -- HTML基础
    第二十九篇 -- 学习第五十六天打卡20190826
    第二篇 -- 软件测试基础
    第一篇 -- 计算机基础
    第二十五篇 -- C++宝典中的图书管理系统
    第五篇 -- 记下曾经的好词好句
    linux平台下Tomcat的安装与优化、windows安装tomcat8.5
    转载:让Windows Server 2012r2 IIS8 ASP.NET 支持10万并发请求
    转载:IIS 之 连接数、并发连接数、最大并发工作线程数、队列长度、最大工作进程数
  • 原文地址:https://www.cnblogs.com/huanshilang/p/11685147.html
Copyright © 2020-2023  润新知