无法在 WebSphere Application Server 8.5.5 中运行 JSF 1.1 应用程序

问题描述

我有一个使用 Sun Java Studio Creator 构建的 JSF 1.1 应用程序的战争,该应用程序在 iPlanet 上运行,我必须在 WAS (WebSphere Application Server) 8.5.5 上运行。由于无限递归,它无法显示欢迎页面。对 SO 上类似问题的回答指出,应删除战争中捆绑的 JSF 库,以防止与 WAS 中的 JSF 运行时发生冲突,但在这种情况下没有帮助。下面是堆栈跟踪

00000107 AdminHelper   A   ADMN1008I: An attempt is made to start the myapp_war application. (User ID = defaultWIMFileBasedRealm/myrealm)
00000107 CompositionUn A   WSVR0190I: Starting composition unit WebSphere:cuname=myapp_war in BLA WebSphere:blaname=myapp_war.
00000107 ApplicationMg A   WSVR0200I: Starting application: myapp_war
00000107 ApplicationMg A   WSVR0204I: Application: myapp_war  Application build level: UnkNown
00000107 SibMessage    I   [:] CWSID0017I: Configuration reload is starting for bus sstP Bus.
00000107 SibMessage    I   [:] CWSID0018I: Configuration reload is complete for bus sstP Bus.
00000107 SibMessage    I   [:] CWSID0019I: Configuration reload is starting for messaging engine mycomputerNode01.bussyst1-sstP Bus.
00000107 SibMessage    I   [:] CWSID0020I: Configuration reload is complete for messaging engine mycomputerNode01.bussyst1-sstP Bus.
00000107 webapp        I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: myapp.war.
00000107 WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: Will create a new session context for application key default_host/myapp
00000107 DefaultFacesC I   Reading standard config meta-inf/standard-faces-config.xml
00000107 DefaultFacesC I   Reading config /WEB-INF/faces-config.xml
00000107 DefaultFacesC I   Reading config : wsjar:file:/opt/IBM/WebSphere/profiles/AppSrv01/installedApps/mycomputerNode01Cell/myapp_war.ear/myapp.war/WEB-INF/lib/appbase.jar!/meta-inf/faces-config.xml
00000107 DefaultFacesC I   Reading config : wsjar:file:/opt/IBM/WebSphere/profiles/AppSrv01/installedApps/mycomputerNode01Cell/myapp_war.ear/myapp.war/WEB-INF/lib/jsfcl.jar!/meta-inf/faces-config.xml
00000107 DefaultFacesC I   Reading config : wsjar:file:/opt/IBM/WebSphere/profiles/AppSrv01/installedApps/mycomputerNode01Cell/myapp_war.ear/myapp.war/WEB-INF/lib/webui.jar!/meta-inf/faces-config.xml
00000107 DefaultFacesC I   Reading config /WEB-INF/navigation.xml
00000107 DefaultFacesC I   Reading config /WEB-INF/managed-beans.xml
00000107 FacesConfigur W   More than one managed bean w/ the name of 'UserDetail' - only keeping the last 
00000107 FacesConfigur W   More than one managed bean w/ the name of 'acesHeaderTabs' - only keeping the last 
00000107 ApplicationIm I   Couldn't discover the current project stage,using Production
00000107 FacesConfigur I   Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
00000107 AbstractFaces I   ServletContext '/opt/IBM/WebSphere/profiles/AppSrv01/installedApps/mycomputerNode01Cell/myapp_war.ear/myapp.war' initialized.
00000107 Digester      W com.sun.faces.config.rules.ComponentRule end [ComponentRule]{faces-config/component} Merge(com.sun.rave.web.ui.Time)
00000107 Digester      W com.sun.faces.config.rules.ConverterRule end [ConverterRule]{faces-config/converter} Merge(null,java.math.BigDecimal)
00000107 Digester      W com.sun.faces.config.rules.ConverterRule end [ConverterRule]{faces-config/converter} Merge(null,java.math.BigInteger)
00000107 Digester      W com.sun.faces.config.rules.NavigationRuleRule end [NavigationRuleRule]{faces-config/navigation-rule} Merge(*)
00000107 Digester      W com.sun.faces.config.rules.NavigationRuleRule end [NavigationRuleRule]{faces-config/navigation-rule} Merge(*)
00000107 Digester      W com.sun.faces.config.rules.ManagedBeanRule end [ManagedBeanRule]{faces-config/managed-bean} Merge(UserDetail)
00000107 Digester      W com.sun.faces.config.rules.ManagedBeanRule end [ManagedBeanRule]{faces-config/managed-bean} Merge(acesHeaderTabs)
00000107 ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [myapp_war] [/myapp] [Faces Servlet]: Initialization successful.
00000107 webcontainer  I com.ibm.ws.webcontainer.VirtualHostImpl addWebApplication SRVE0250I: Web Module null has been bound to default_host[*:9080,*:80,*:9443,*:5060,*:5061,*:443].
00000107 ApplicationMg A   WSVR0221I: Application started: myapp_war
00000107 CompositionUn A   WSVR0191I: Composition unit WebSphere:cuname=myapp_war in BLA WebSphere:blaname=myapp_war started.
0000010a ServletWrappe I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [myapp_war] [/myapp] [/JSCreator_index.jsp]: Initialization successful.
0000010a ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet Faces Servlet: java.lang.StackOverflowError
at javax.faces.context.FacesContext.getAttributes(FacesContext.java:64)
at javax.faces.context.FacesContext.getAttributes(FacesContext.java:64)
at javax.faces.context.FacesContext.getAttributes(FacesContext.java:64)
at javax.faces.context.FacesContext.getAttributes(FacesContext.java:64)
at javax.faces.context.FacesContext.getAttributes(FacesContext.java:64)
<--     many such lines -->
at org.apache.myfaces.application.ResourceHandlerImpl.isResourceRequest(ResourceHandlerImpl.java:459)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:180)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
at com.ibm.ws.webcontainer.webapp.WebAppRequestdispatcher.dispatch(WebAppRequestdispatcher.java:1404)
at com.ibm.ws.webcontainer.webapp.WebAppRequestdispatcher.forward(WebAppRequestdispatcher.java:196)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:601)
at com.ibm._jsp._JSCreator_5F_index._jspService(_JSCreator_5F_index.java:83)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:220)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
at com.ibm.ws.webcontainer.webapp.WebAppRequestdispatcher.dispatch(WebAppRequestdispatcher.java:1404)
at com.ibm.ws.webcontainer.webapp.WebAppRequestdispatcher.forward(WebAppRequestdispatcher.java:196)
at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:681)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4047)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1016)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:213)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handlediscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)

faces-config.xml 基本是空的,web.xml 的相关部分是

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems,Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
  </context-param>
<context-param>
    <param-name>javax.faces.CONfig_FILES</param-name>
    <param-value>/WEB-INF/navigation.xml,/WEB-INF/managed-beans.xml</param-value>
  </context-param>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
<welcome-file-list>
    <welcome-file>JSCreator_index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

解决方法

WebSphere 8.5.x 附带的 JSF 实现是 MyFaces,版本是 2.0。 您需要使用 SunRI 作为 JSF 版本才能在您的应用程序中支持 JSF 1.1。

请注意,这会影响整个应用服务器,而不仅仅是您为其配置的应用程序。

有关详细信息,请参阅此链接Changing JSF version