spring异常Unsatisfieddependencyexpressedthrough。。。
异常信息:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxx' defined in file [G:\MagicMed\SVN\gouxinjie\trunk\procedure\MagicMedEcg\target\MagicMedEcg\WEB-INF\classes\com\magicmed\ec at org.springframework.beans.factory.ateArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.ateBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(Abst
ractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.ateBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.Object(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.Singleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
10-Sep-2018 18:19:20.631 严重 [RMI TCP Connection(3)-127.0.0.1] org.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
at org.springframework.beans.factory.Bean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
10-Sep-2018 18:19:20.633 严重 [RMI TCP Connection(3)-127.0.0.1] org.StandardContext.startInternal Context [/MagicMedEcg] startup failed due to previous errors
at t.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at t.fresh(AbstractApplicationContext.java:543)
at org.figureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.t.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.tInitialized(ContextLoaderListener.ja
va:107)
at org.StandardContext.listenerStart(StandardContext.java:4853)
at org.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.ContainerBase.addChildInternal(ContainerBase.java:753)
at org.ContainerBase.addChild(ContainerBase.java:729)
at org.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1733)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at flect.Method.invoke(Method.java:498)
at deler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.ateStandardContext(MBeanFactory.java:484)
at org.apache.catalina.ateStandardContext(MBeanFactory.java:433)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at flect.Method.invoke(Method.java:498)
at deler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at i.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at i.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at i.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at i.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at i.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at flect.Method.invoke(Method.java:498)
i.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
i.transport.Transport$1.run(Transport.java:200)
i.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
i.transport.Transport.serviceCall(Transport.java:196)
p.TCPTransport.handleMessages(TCPTransport.java:568)
p.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
p.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
p.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at urrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at urrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)spring framework版本
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.lang.String' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1493)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)
at org.springframework.beans.factory.solveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.solveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.ateArgumentArray(ConstructorResolver.java:741)
... 60 more
问题解决:由于在类⾥⾯定义了“有参构造⽅法”,这样的话就会覆盖原先的“⽆参构造⽅法”,所以会出现此异常,所以在类⾥⾯加上“⽆参构造⽅法”就完
了(折磨了好长时间,特此记录⼀下)。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论