项目启动报错:“java.lang.IllegalStateException: ApplicationEventMulticaster not initialized”

   今天项目启动时,发现报错:“java.lang.IllegalStateException: ApplicationEventMulticaster not initialized”

网上查资料发现可能原因是jar包冲突的原因。

后来定位发现是因为给相同的类名同时加上了@Service注解导致初始化项目报错。

java.lang.IllegalStateException: BeanFactory not initialized or already closed

12-14

在进行SSh整合时,启动服务器出现了很多异常,其中一个是Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor,但是我已经添加了aopalliance-1.0.jar,还是找不到这个类,rn[code=java]严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:413)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)rn at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)rn at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:621)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)rn at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn at org.springframework.transaction.config.AnnotationDrivenBeanDefinitionParser$AopAutoProxyConfigurer.configureAutoProxyCreator(AnnotationDrivenBeanDefinitionParser.java:127)rn at org.springframework.transaction.config.AnnotationDrivenBeanDefinitionParser.parse(AnnotationDrivenBeanDefinitionParser.java:84)rn at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)rn at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1424)rn at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1414)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:187)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:110)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)rn ... 37 morernCaused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptorrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn ... 55 morern2014-12-14 16:30:43 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn2014-12-14 16:30:43 org.apache.catalina.core.StandardContext startrn严重: Context [/ssh] startup failed due to previous errorsrn2014-12-14 16:30:43 org.apache.catalina.core.ApplicationContext logrn信息: Closing Spring root WebApplicationContextrn2014-12-14 16:30:43 org.apache.catalina.core.StandardContext listenerStoprn严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnjava.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContextrn at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)rn at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:921)rn at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:895)rn at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)rn at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:579)rn at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)rn at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4249)rn at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4890)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4754)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)[/code]rnrn求救,已经搞了半个下午了

java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refr

08-16

java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Fri Aug 16 13:50:39 CST 2013]; root of context hierarchyrn at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:370)rn at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1060)rn at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1013)rn at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:559)rn at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)rn at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4927)rn at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5573)rn at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:724)rn

tomcat8启动报错 java.lang.IllegalStateException

06-12

java.lang.IllegalArgumentExceptionrn at org.springframework.asm.ClassReader.(Unknown Source)rn at org.springframework.asm.ClassReader.(Unknown Source)rn at org.springframework.asm.ClassReader.(Unknown Source)rn at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:52)rn at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)rn at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)rn at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)rn at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)rn at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)rn at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)rn at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)rn at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)rn at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)rn at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4738)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)rn at java.util.concurrent.FutureTask.run(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)rnrn

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试