java吧 关注:1,256,781贴子:12,748,384

“淘淘商城”这么经典的项目为什么我就做不来呢

只看楼主收藏回复



IP属地:四川1楼2017-12-27 15:34回复
    最经典的培训项目是什么,没错,肯定是淘淘商城了,最近在做淘淘商城,第一天的项目就遇到了三四中问题每个问题都一两天才能解决,感觉自己搭Maven好难啊,这次遇到个问题是在找不到答案了, 求救


    IP属地:四川2楼2017-12-27 15:36
    回复(2)
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taotao.serviceImpl.ItemServiceImpl com.taotao.controller.ItemController.itemService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taotao.serviceImpl.ItemServiceImpl] 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)}


      IP属地:四川3楼2017-12-27 15:37
      回复


        IP属地:四川5楼2017-12-27 15:41
        收起回复
          创建bean itemController的时候报错了 不能注入你的ItemServiceImpl 看看你的service是否加了@Service注解 然后检查下Spring的配置文件有没有在里面注入service的bean


          IP属地:广东6楼2017-12-27 15:42
          收起回复



            IP属地:四川8楼2017-12-27 15:49
            回复
              @service引入的包名是spring的包吗


              IP属地:山东10楼2017-12-27 16:11
              收起回复
                昨天是面试,一个喊两年经验的说最近做的是一个商城项目。。。。。。


                IP属地:广东11楼2017-12-27 16:12
                收起回复
                  如果注入了dubbo的@service会导致这样,因为你的类并没有在Spring容器中注册,dubbo的@service是rpc框架用的


                  IP属地:山东12楼2017-12-27 16:13
                  收起回复
                    加油


                    IP属地:云南来自Android客户端13楼2017-12-27 16:17
                    收起回复
                      严重怀疑web.xml添加spring容器出错了所以Service装载失败,
                      但是添加springMvc倒是成功了,Controller能用


                      IP属地:四川14楼2017-12-27 16:22
                      回复


                        IP属地:四川15楼2017-12-27 16:28
                        收起回复


                          IP属地:四川16楼2017-12-27 16:29
                          收起回复
                            是不是因为Maven的关系哪里没配置好啊, 还是应为Maven的关系配置文件放的位置不对


                            IP属地:四川17楼2017-12-27 16:31
                            回复
                              你就直接把第一天的源码复制粘贴呗。第一天纠结它干嘛,浪费时间。


                              IP属地:辽宁来自Android客户端18楼2017-12-27 16:40
                              收起回复