Scoped代理标记未生效 - 配置错误?

时间:2018-02-21 08:59:20

标签: spring spring-boot aop spring-aop

我继承了一点怪物系统。它是一个旨在在Weblogic上运行的Spring框架服务器。

现在的代码似乎非常适合其他开发人员。我可以毫无错误地清理,编译和打包项目。但是,当我尝试将生成.war文件部署到我的Weblogic服务器时,出现以下错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.com.example.portal.uil.delegate.ExceptionLogDelegate': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

此错误将我指向以下bean,该bean位于外部库中:

<bean id="com.externalLibrary.ExceptionLogDelegate" class="com.externalLibrary.ExceptionLogDelegate" scope="session">
    <aop:scoped-proxy />
    <property name="errorLogBuffer" ref="com.externalLibrary.ErrorLogDao" />
</bean>

在搜索该错误一段时间之后,似乎最常见的是省略aop:scope-proxy标记。这个bean正在加载:

<bean id="exceptionResolver" class="foo.mypackage.SoapFaultDetailExceptionResolver">
    <property name="marshaller" ref="marshaller"/>
    <property name="exceptionLogDelegate" ref="foo.mypackage.ExceptionLogDelegate"/>
</bean>

奇怪的是,没有文件更改,这个确切的代码在我的同事的机器上工作正常,所以我假设我错过了一些神奇的配置步骤。

也许有人可能会指点我寻找的东西吗?

亲切的问候

0 个答案:

没有答案