服务器启动后,发现无法创建bean,类确定存在,配置文件也没有问题,请问是什么原因造成这个异常

DoubleSin 发布于 2017/08/10 09:37
阅读 150
收藏 0

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testAction' defined in ServletContext resource [/WEB-INF/applicationContext-test.xml]: Cannot resolve reference to bean 'tencentMusicAction' while setting bean property 'tencentMusicAction'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.demo.web.action.TencentMusicAction] for bean with name 'tencentMusicAction' defined in ServletContext resource [/WEB-INF/applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: com.demo.web.action.TencentMusicAction

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

at java.security.AccessController.doPrivileged(Native Method)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.demo.web.action.TencentMusicAction] for bean with name 'tencentMusicAction' defined in ServletContext resource [/WEB-INF/applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: com.demo.web.action.TencentMusicAction

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1102)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:386)

at java.security.AccessController.doPrivileged(Native Method)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

... 42 more

Caused by: java.lang.ClassNotFoundException: com.demo.web.action.TencentMusicAction

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

at org.springframework.util.ClassUtils.forName(ClassUtils.java:242)

at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:383)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1135)

... 52 more

八月 10, 2017 9:33:05 上午 org.apache.catalina.core.StandardContext listenerStart

SEVERE: Exception sending context initialized event to listener instance of class com.demo.web.ConfigListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testAction' defined in ServletContext resource [/WEB-INF/applicationContext-test.xml]: Cannot resolve reference to bean 'tencentMusicAction' while setting bean property 'tencentMusicAction'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.demo.web.action.TencentMusicAction] for bean with name 'tencentMusicAction' defined in ServletContext resource [/WEB-INF/applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: com.demo.web.action.TencentMusicAction

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

at java.security.AccessController.doPrivileged(Native Method)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.demo.web.action.TencentMusicAction] for bean with name 'tencentMusicAction' defined in ServletContext resource [/WEB-INF/applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: com.demo.web.action.TencentMusicAction

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1102)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:386)

at java.security.AccessController.doPrivileged(Native Method)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

... 42 more

Caused by: java.lang.ClassNotFoundException: com.demo.web.action.TencentMusicAction

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

at org.springframework.util.ClassUtils.forName(ClassUtils.java:242)

at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:383)

at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1135)

... 52 more

加载中
返回顶部
顶部