org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为'masterServicelmpl'的bean时出错:

时间:2019-05-02 21:13:23

标签: javabeans ssm

我正在使用mybatis反向生成mapper和pojo,但出现bean错误。

org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为'masterServicelmpl'的bean时出错:通过字段'tbMastersMapper'表示的不满足的依赖关系;嵌套的异常是org.springframework.beans.factory.NoSuchBeanDefinitionException:没有类型为'com.irs.mapper.TbMastersMapper'的合格Bean:预计至少有1个合格为自动装配候选的Bean。依赖项注释:{@ org.springframework.beans.factory.annotation.Autowired(required = true)} 相关原因:org.springframework.beans.factory.BeanCreationException:在文件[D:\ code \ template \ irs-maven \ target \ ssm \ WEB-INF \ classes \ com \ irs \中创建名称为'tbMastersMapper'的bean时出错mapper \ TbMastersMapper.class]:调用init方法失败;嵌套的异常是java.lang.IllegalArgumentException:org.apache.ibatis.builder.BuilderException:解析Mapper XML时出错。原因:java.lang.IllegalArgumentException:结果映射集合已经包含com.irs.mapper.TbMastersMapper.BaseResultMap的值     在org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor $ AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)处     在org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)     在org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)处     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)     在org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:306)     在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)     在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)     在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)     在org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)     在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)     在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)     在org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)处     在org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)     在org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)     在org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4852)     在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5313)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)     在org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)     在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)     在org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)     在org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1730)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处     在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:498)     在org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)     在com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)     在com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)     在org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484)     在org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处     在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:498)     在org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)     在com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)     在com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)     在com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)     在javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)     在javax.management.remote.rmi.RMIConnectionImpl.access $ 300(RMIConnectionImpl.java:76)     在javax.management.remote.rmi.RMIConnectionImpl $ PrivilegedOperation.run(RMIConnectionImpl.java:1309)     在java.security.AccessController.doPrivileged(本机方法)     在javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)     在javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处     在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:498)     在sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)     在sun.rmi.transport.Transport $ 1.run(Transport.java:200)     在sun.rmi.transport.Transport $ 1.run(Transport.java:197)     在java.security.AccessController.doPrivileged(本机方法)     在sun.rmi.transport.Transport.serviceCall(Transport.java:196)     在sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)     在sun.rmi.transport.tcp.TCPTransport $ ConnectionHandler.run0(TCPTransport.java:826)     在sun.rmi.transport.tcp.TCPTransport $ ConnectionHandler.lambda $ run $ 0(TCPTransport.java:683)     在java.security.AccessController.doPrivileged(本机方法)     在sun.rmi.transport.tcp.TCPTransport $ ConnectionHandler.run(TCPTransport.java:682)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745) 由以下原因引起:org.springframework.beans.factory.NoSuchBeanDefinitionException:没有类型为“ com.irs.mapper.TbMastersMapper”的合格Bean:预期至少有1个合格为自动装配候选的Bean。依赖项注释:{@ org.springframework.beans.factory.annotation.Autowired(required = true)}     在org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1486)     在org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)     在org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)     在org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor $ AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)处     ...另外62个

0 个答案:

没有答案