java.lang.IllegalStateException:LifecycleProcessor未初始化 - 在通过上下文调用生命周期方法之前调用'refresh' [英] java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context

查看:858
本文介绍了java.lang.IllegalStateException:LifecycleProcessor未初始化 - 在通过上下文调用生命周期方法之前调用'refresh'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用maven_spring 3.1.M2 + hibernate 3.5。在我的applicationcontex xml文件中放入< tx:annotation-driven /> 行后,会出现以下错误:

I'm using maven_spring 3.1.M2 + hibernate 3.5. Once I put the line <tx:annotation-driven /> in my applicationcontex xml file, the follwoing error will occur:

WARNING: Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Sat Jul 16 13:00:52 IST 2011]; root of context hierarchy
    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:350)
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1033)
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:988)
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:534)
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4721)
    at org.apache.catalina.core.StandardContext$4.call(StandardContext.java:5423)
        at org.apache.catalina.core.StandardContext$4.call(StandardContext.java:5402)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

我应该怎么做才能解决这个问题?

What should I do to fix this?

推荐答案

您的pom.xml中是否包含AspectJ?你的lib目录?

Do you have AspectJ in your pom.xml or in your lib-directory?

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aspects</artifactId>
    <version>3.1.0.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjrt</artifactId>
    <version>${aspectj.version}</version>
</dependency>
<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>${aspectj.version}</version>
</dependency>

我有同样的错误,这解决了我的问题。

I had the same error and this solved my problem.

这篇关于java.lang.IllegalStateException:LifecycleProcessor未初始化 - 在通过上下文调用生命周期方法之前调用'refresh'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆