zoukankan      html  css  js  c++  java
  • 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类里把注解类路径改对就好了。

  • 相关阅读:
    uptime---系统总共运行时间和系统的平均负载
    top---实时动态地查看系统的整体运行情况
    dmesg---检查和控制内核的环形缓冲区
    sysctl---内核参数相关设置
    C++笔记011:C++对C的扩展——变量检测增强
    C++笔记010:C++对C的扩展——register关键字增强
    C++笔记009:C++对C的扩展——“实用性”增加
    C++笔记008:C++对C的扩展——命名空间 namespace基础
    C++笔记007:易犯错误模型——类中为什么需要成员函数
    C++笔记006:关于类的补充
  • 原文地址:https://www.cnblogs.com/huanshilang/p/11685147.html
Copyright © 2011-2022 走看看