zoukankan      html  css  js  c++  java
  • MAVEN导入其他模块的jar包报错???

    在做一个分布式的项目,其中购物车模块需要使用单点登录模块的方法。

    我在购物车模块的pom.xml下导入了单点登录模块的接口方法。

    编译没有问题,但是启动tomcat的时候提示

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cartForController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.sso.UserRegister com.taotao.cart.controller.CartForController.userRegister; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.sso.UserRegister] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    简单来说就是注解注入失败了。

    找了一天没什么思路,请大家帮忙看看

    这是购物车模块的pom.xml

     这是目录结构:

    Controller类中:

     注入进来后能调用里面的方法:

    编译也没有问题。

    但是,在启动tomcat的时候,

    就会出现最上面的那个错误,说没有注入进来。这是什么原因。。。想的脑壳都疼了。、

  • 相关阅读:
    操作系统的发展史
    多线程的些许理解(平台x86,具体考虑linux,windows)
    C++ 11 智能指针
    C++虚函数和纯虚函数
    Qt之excel 操作使用说明
    查找之二叉排序树
    图的一些总结
    树的一些总结
    直接插入排序
    冒泡和选择排序
  • 原文地址:https://www.cnblogs.com/zzzhw/p/11835012.html
Copyright © 2011-2022 走看看