`

found for dependency: expected at least 1 bean which qualifies as autowire

 
阅读更多

2014-05-01 18:28:44.112:WARN:/mideaAdmin:unavailable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'goodsTypeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.hailong.midea.busi.goodstype.manager.GoodsTypeManager com.hailong.midea.web.controller.goodstype.GoodsTypeController.goodsTypeManager; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.hailong.midea.busi.goodstype.manager.GoodsTypeManager] 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)}
 at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
 at javax.servlet.GenericServlet.init(GenericServlet.java:242)
 at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:492)
 at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:312)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:776)
 at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:258)
 at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1213)
 at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:699)
 at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
 at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
 at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
 at org.eclipse.jetty.server.Server.doStart(Server.java:263)
 at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
 at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
 at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:514)
 at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

 

解决方案:

出现此错误的原因是因为在action注入了service ,而spring容器并没有找到这个service 注解标识,导致注入action时注入失败。

 

在service类中的上方加入@service 标示是service业务层即可。

重启服务器,问题解决。

分享到:
评论

相关推荐

    Unresolved dependency: 'com.aspose:aspose:jar:19'

    1. **检查仓库配置**:首先确认`settings.xml`中的仓库配置是否正确,包括阿里云仓库的URL。如果仓库URL没有问题,那么可能是该仓库没有存储这个特定的依赖版本。 2. **寻找替代源**:如果官方仓库或默认镜像无法...

    vue3+express

    vue3 + express的项目中报错:warning in ./node_modules/express/lib/view.js, Critical dependency: the request of a dependency is an expression 的解决方案。 必能解决。

    成功解决Unable to resolve dependency、classpath等所有有关环境配置的问题

    (第一次写文章,我经验也不足,根据自己的理解来向大家解释一下) 先说一说今天被折磨一整天的感悟: 当项目导入、运行爆红时,一个劲百度出现的错误和解决方案,可能不是最先做的事。 加深对于项目运行过程的理解...

    closure dependency not found解决包

    当我们从github上下载了blockly之后,打卡demos下的index.html时,选择blockly-developer-tools时会弹出一个对话框(大体内容是closure dependency not found),此时我们需要下载这个文件,解压并且命名为closure-...

    junit-4.12.rar包及依赖包

    1. 确保你的项目构建工具(如Maven或Gradle)配置了正确的JUnit依赖。对于JUnit 4.12,对应的Maven依赖是: ```xml <dependency> <groupId>junit <artifactId>junit <version>4.12 <scope>test </dependency> ``...

    glibc-headers-2.12-1.212.el6_10.3.x86_64.rpm

    linux系统,rpm资源glibc-headers-2.12-1.212.el6_10.3.x86_64.rpm,适用于centos6.9,没有在centos7上进行测试。

    aspose-words-15.8.0-jdk16.jar.rar

    <dependency> <groupId>com.itextpdf</groupId> <artifactId>itext7-core <version>7.1.0 <type>pom </dependency> <dependency> <groupId>com.itextpdf</groupId> <artifactId>html2pdf</artifactId> ...

    Android代码-Android-ParallaxSupportView

    Gradle dependency: compile 'homhomlin.lib:psv-library:1.0.1' or Maven dependency: homhomlin.lib psv-library 1.0.1 API v12 : Gradle dependency: compile 'homhomlin.lib.v12:psv-library:1.0.1' or ...

    Maven的Dependency详解

    《Maven的Dependency详解》 在软件开发过程中,依赖管理是一项关键任务,尤其是在Java领域,Maven通过其强大的依赖管理机制简化了这一过程。Maven的Dependency是项目构建中的核心概念,它允许开发者声明项目所需的...

    ojdbc6 解决maven缺失问题

    因此,当Maven尝试构建项目并找不到ojdbc6时,会抛出“not found”错误。 解决这个问题有几种方法: 1. **本地添加**:你可以将ojdbc6.jar文件手动添加到你的本地Maven仓库。通常,这个仓库位于用户的主目录下的`....

    Android代码-Liqp

    Liqp ...in your local Maven repository, as well as in the project's target/ folder. Usage This library can be used in two different ways: to construct a parse tree of some Liquid inp

    Junit4.12和依赖包

    还有`@Ignore`注解可以临时忽略某个测试,`@Expected`用于指定预期的异常等。 其次,Junit4.12提供了断言(Assertion)机制,用于检查代码的运行结果是否符合预期。例如,`assertEquals()`用于比较两个值是否相等,...

    Spring的Bean配置说明

    ### Spring的Bean配置详解 #### 一、Spring配置文件根元素`<beans>`解析 - **功能概述**:`<beans>`是Spring配置文件的根元素,用来包含一个或多个`<bean>`元素,用于定义Spring容器管理的各种Bean。 #### 二、`...

    yii-tags-dependency:基于Yii框架的Dependency机制验证缓存相关性

    yii-标签依赖 基于 Yii 框架和标签的依赖机制验证...// save any value into cache with this dependency $ cache -> set ( 'cacheKey' , 'cacheValue' , 0 , new TagsDependency ([ 'A' , 'B' ])); // check if th

    rsyslog-kafka-8.24.0-34.el7.x86_64.rpm

    离线安装包,亲测可用

    kingbase8.2和8.6版本

    <dependency> <groupId>com.kingbase</groupId> <artifactId>kingbase8 <version>8.2.0 </dependency> <dependency> <groupId>com.kingbase</groupId> <artifactId>kingbase8 <version>8.6.0 </...

    Dependency Injection Principles, Practices, and Patterns

    As you dive into the thoroughly-explained examples, you'll develop a foundation you can apply to any of the many DI libraries for .NET and .NET Core. Purchase of the print book includes a free eBook ...

    Android代码-虽然发了很多个 Pin 码效果的 UI 裤子,但是这个相对好看和正规一些。

    Pinview Pinview library for android :pouting_cat: Gradle Dependency ... : 1: Features : Flawless focus change to the consecutive pin box when the text is entered/deleted. When the use

    Apache Maven Dependency Management

    Chapter 1: Basic Dependency Management Chapter 2: Dependency Mechanism and Scopes Chapter 3: Dependency Designation (advanced) Chapter 4: Migration of Dependencies to Apache Maven Chapter 5: Tools ...

Global site tag (gtag.js) - Google Analytics