WebLogic 12c上的JSF 2中的Stackoverflow错误

时间:2017-07-05 18:09:08

标签: java jsp jsf jsf-2 weblogic12c

我正在开发一个混合了传统JSP servlet代码和更新的JSF代码的应用程序。我遇到了无法解决的StackOverlow错误。有没有人见过或经历过类似的东西,可以帮助我指出这种混合JSP / JSF应用程序的正确方向?

我很确定JSF框架正在尝试在非JSF页面上执行某些操作,并且正在JSF框架内的递归循环中被捕获。我在集群WebLogic 12.1.3环境中使用JSF 2.1.20。我没有在我的EAR或WAR文件中捆绑任何JSF库,我正在使用所有内容的服务器版本。

我做了很多搜索,发现了其他类似的问题,但到目前为止,没有一个解决方案对我有任何影响。主要区别似乎是我的错误非常随机,不会一直发生,也不会发生在同一个地方或同一个对象上。

我的堆栈跟踪在下面...一旦我到达“由...引起”部分,我可以看到相同的行反复重复,表明我的应用程序正在尝试查找或使用JSF执行某些操作并失败。我没有粘贴整个堆栈跟踪,因为它只是重复行286到143超过1000次,直到堆栈最终填满并抛出错误。

2017-07-05 10:06:00,133 [[ACTIVE] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'] FATAL SecurityFilter        Msg=[EVENT FAILURE xxxxxxx -> /SecurityFilter] Error in ESAPI security filter: java.lang.StackOverflowError  UserId=xxxxxxx
javax.servlet.ServletException: java.lang.StackOverflowError
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:600)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:275)
    at myapp.pkg.AcctSummaryAction.perform(AcctSummaryAction.java:158)
    at myapp.pkg.DispatcherSec.processRequest(DispatcherSec.java:119)
    at myapp.pkg.DispatcherSec.doGet(DispatcherSec.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at myapp.navigation.JsfRequestFilter.doFilter(JsfRequestFilter.java:187)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at myapp.esapi.filters.SecurityFilter.doFilter(SecurityFilter.java:147)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at myapp.common.MdcFilter.doFilter(MdcFilter.java:68)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at myapp.navigation.DisplayProcessingFilter.doFilter(DisplayProcessingFilter.java:118)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at myapp.common.NoCacheFilter.doFilter(NoCacheFilter.java:68)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3431)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3397)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2280)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2196)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1621)
    at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:256)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
Caused by: java.lang.StackOverflowError
    at javax.faces.context.FacesContext.getCurrentInstance(FacesContext.java:832)
    at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:715)
    at javax.faces.FactoryFinder$FactoryManagerCache.access$100(FactoryFinder.java:690)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:340)
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:141)
    at com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:286)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:158)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:136)
    at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:386)
    at com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:203)
    at com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:214)
    at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:107)
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:143)
    at com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:286)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:158)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:136)
    at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:386)
    at com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:203)
    at com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:214)
    at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:107)
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:143)
    at com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:286)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:158)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:136)
    at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:386)
    at com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:203)
    at com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:214)
    at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:107)
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:143)
    at com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:286)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:158)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:136)
    at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:386)
    at com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:203)
    at com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:214)
    at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:107)
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:143)
    at com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:286)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:158)
    at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:136)
    at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:386)
    at com.sun.faces.application.ApplicationAssociate.<init>(ApplicationAssociate.java:203)
    at com.sun.faces.application.ApplicationImpl.<init>(ApplicationImpl.java:214)
    at com.sun.faces.application.ApplicationFactoryImpl.getApplication(ApplicationFactoryImpl.java:107)
    ...
    Etc............ (lines 286 to 107 repeat over and over)

我已经研究过的一些事情的例子还没有帮助我:

编辑:我想我已经将问题追溯到我的weblogic.xml文件中的设置:“persistent-store-type = replicated_if_clustered”(见下文)。删除此设置后,我无法重现错误。看来这个应用程序在我的集群中的服务器之间没有很好地序列化。内部WebLogic日志在我的应用程序中的随机类上显示复制错误。希望它能帮助别人。如果我的错误在接下来的几天测试中没有再出现,我会回来并将其标记为已解决。

<?xml version = '1.0' encoding = 'windows-1252'?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.5/weblogic-web-app.xsd"
    xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
    <jsp-descriptor>
        <precompile>true</precompile>
    </jsp-descriptor>
    <container-descriptor>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    <session-descriptor>
        <cookie-secure>true</cookie-secure>
        <cookie-http-only>true</cookie-http-only>        
        <!--<persistent-store-type>replicated_if_clustered</persistent-store-type>-->
        <url-rewriting-enabled>false</url-rewriting-enabled>
    </session-descriptor> 
</weblogic-web-app>

EDIT2:似乎还存在库冲突。我没有发送我的JSTL库和标签库与项目,因为它应该在服务器上。当我改变我的部署以包含这个.jar(glassfish.jstl_1.0.0.0_1-2-2-0.jar)时,它也使我的很多错误消失了,所以我的应用程序一定不能一直找到我的库以为它找到了。

1 个答案:

答案 0 :(得分:0)

我通过做一些事情来解决它,问题最终是weblogic设置和库冲突的结合。完整的详细信息在原始帖子的编辑中:

  1. 从weblogic.xml中删除了“replicated_if_clustered”设置。
  2. 将带有.war文件的JSTL标记库(glassfish.jstl_1.0.0.0_1-2-2-0.jar)打包到服务器。
  3. 审核了我的其余部署设置,并确保我没有向项目发送任何JSF,JSP运行时,ADF等库,以避免我和服务器之间发生任何其他库冲突。
  4. 我还特别发现JDeveloper默认部署了“Resource Bundle Variable Resolver”库,它导致了一些奇怪的库冲突,所以我也从我的部署配置文件中删除了它。
  5. 我没有在日志文件中看到任何更多错误,并且由于包含这些更改,因此它非常稳定。