WebSphere7.0 上部署struts2 找不到用于处理 JSP 的扩展处理器
最近有个项目将要用到WebSphere,所以我提前来熟悉一下,在WebSphere7.0上安装完一个struts2的小项目测试,在tomcat下该项目没有任何问题,当我把tomcat下打包的war包在WebSphere中安装后,就只能访问html页面了,其余的struts2的请求,跟jsp页面都不能访问,提示您无权查看此页面,跑到日志文件中发现,启动时有如下错误:
[
10
-
8
-
18
15
:
17
:
41
:
079
CST]
00000010
webapp E com.ibm.ws.webcontainer.webapp.WebApp initializeExtensionProcessors SRVE0280E: 扩展处理器无法在工厂 [com.ibm.ws.jsp.webcontainerext.ws.WASJSPExtensionFactory@2bec2bec] 中进行初始化:java.lang.ClassCastException: com.sun.faces.application.WebappLifecycleListener incompatible with java.util.EventListener
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor. < init > (AbstractJSPExtensionProcessor.java: 250 )
at com.ibm.ws.jsp.webcontainerext.ws.WASJSPExtensionProcessor. < init > (WASJSPExtensionProcessor.java: 70 )
at com.ibm.ws.jsp.webcontainerext.ws.WASJSPExtensionFactory.createProcessor(WASJSPExtensionFactory.java: 251 )
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionFactory.createExtensionProcessor(AbstractJSPExtensionFactory.java: 75 )
at com.ibm.ws.webcontainer.webapp.WebApp.initializeExtensionProcessors(WebApp.java: 1313 )
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java: 360 )
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java: 298 )
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java: 100 )
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java: 166 )
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java: 731 )
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java: 616 )
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java: 376 )
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java: 668 )
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java: 1122 )
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java: 1315 )
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java: 619 )
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java: 940 )
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java: 725 )
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java: 2046 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java: 439 )
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java: 123 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java: 382 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$ 300 (CompositionUnitMgrImpl.java: 110 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java: 949 )
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java: 349 )
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java: 1550 )
[ 10 - 8 - 18 15 : 17 : 41 : 562 CST] 00000010 config I Initializing Sun ' s JavaServer Faces implementation (1.2_07-b03-FCS) for context ' / cc '
[ 10 - 8 - 18 15 : 17 : 44 : 579 CST] 00000010 webapp W com.ibm.ws.webcontainer.webapp.WebApp initializeTargetMappings SRVE0269W: 找不到用于处理 JSP 的扩展处理器。
[ 10 - 8 - 18 15 : 17 : 44 : 584 CST] 00000010 webcontainer I com.ibm.ws.wswebcontainer.VirtualHost addWebApplication SRVE0250I: Web 模块 null 已绑定到 default_host[ * : 9080 , * : 80 , * : 9443 , * : 5060 , * : 5061 , * : 443 ]。
[ 10 - 8 - 18 15 : 17 : 44 : 616 CST] 0000000f webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: 正在装入 Web 模块:WIM。
[ 10 - 8 - 18 15 : 17 : 44 : 793 CST] 0000000f WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: 将为应用程序键 admin_host / wim 创建新的会话上下文
[ 10 - 8 - 18 15 : 17 : 44 : 933 CST] 0000000f webcontainer I com.ibm.ws.wswebcontainer.VirtualHost addWebApplication SRVE0250I: Web 模块 WIM 已绑定到 admin_host[ * : 9060 , * : 9043 ]。
[ 10 - 8 - 18 15 : 17 : 45 : 194 CST] 00000011 webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: 正在装入 Web 模块:PlantsByWebSphere Sample Gallery Web Application。
[ 10 - 8 - 18 15 : 17 : 45 : 262 CST] 00000010 ApplicationMg A WSVR0221I: 应用程序已启动:StrutsTest_war
[ 10 - 8 - 18 15 : 17 : 45 : 288 CST] 00000010 CompositionUn A WSVR0191I: 已启动 BLA WebSphere:blaname = StrutsTest_war 中的组合单元 WebSphere:cuname = StrutsTest_war。
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor. < init > (AbstractJSPExtensionProcessor.java: 250 )
at com.ibm.ws.jsp.webcontainerext.ws.WASJSPExtensionProcessor. < init > (WASJSPExtensionProcessor.java: 70 )
at com.ibm.ws.jsp.webcontainerext.ws.WASJSPExtensionFactory.createProcessor(WASJSPExtensionFactory.java: 251 )
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionFactory.createExtensionProcessor(AbstractJSPExtensionFactory.java: 75 )
at com.ibm.ws.webcontainer.webapp.WebApp.initializeExtensionProcessors(WebApp.java: 1313 )
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java: 360 )
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java: 298 )
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java: 100 )
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java: 166 )
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java: 731 )
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java: 616 )
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java: 376 )
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java: 668 )
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java: 1122 )
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java: 1315 )
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java: 619 )
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java: 940 )
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java: 725 )
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java: 2046 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java: 439 )
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java: 123 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java: 382 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$ 300 (CompositionUnitMgrImpl.java: 110 )
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java: 949 )
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java: 349 )
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java: 1550 )
[ 10 - 8 - 18 15 : 17 : 41 : 562 CST] 00000010 config I Initializing Sun ' s JavaServer Faces implementation (1.2_07-b03-FCS) for context ' / cc '
[ 10 - 8 - 18 15 : 17 : 44 : 579 CST] 00000010 webapp W com.ibm.ws.webcontainer.webapp.WebApp initializeTargetMappings SRVE0269W: 找不到用于处理 JSP 的扩展处理器。
[ 10 - 8 - 18 15 : 17 : 44 : 584 CST] 00000010 webcontainer I com.ibm.ws.wswebcontainer.VirtualHost addWebApplication SRVE0250I: Web 模块 null 已绑定到 default_host[ * : 9080 , * : 80 , * : 9443 , * : 5060 , * : 5061 , * : 443 ]。
[ 10 - 8 - 18 15 : 17 : 44 : 616 CST] 0000000f webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: 正在装入 Web 模块:WIM。
[ 10 - 8 - 18 15 : 17 : 44 : 793 CST] 0000000f WASSessionCor I SessionContextRegistry getSessionContext SESN0176I: 将为应用程序键 admin_host / wim 创建新的会话上下文
[ 10 - 8 - 18 15 : 17 : 44 : 933 CST] 0000000f webcontainer I com.ibm.ws.wswebcontainer.VirtualHost addWebApplication SRVE0250I: Web 模块 WIM 已绑定到 admin_host[ * : 9060 , * : 9043 ]。
[ 10 - 8 - 18 15 : 17 : 45 : 194 CST] 00000011 webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: 正在装入 Web 模块:PlantsByWebSphere Sample Gallery Web Application。
[ 10 - 8 - 18 15 : 17 : 45 : 262 CST] 00000010 ApplicationMg A WSVR0221I: 应用程序已启动:StrutsTest_war
[ 10 - 8 - 18 15 : 17 : 45 : 288 CST] 00000010 CompositionUn A WSVR0191I: 已启动 BLA WebSphere:blaname = StrutsTest_war 中的组合单元 WebSphere:cuname = StrutsTest_war。
网上百度了一大堆都没有解决掉,
有的说在应用程序服务器 > WebSphere_Portal > Web 容器 > 定制属性->新建属性
com.ibm.ws.webcontainer.invokefilterscompatibility true
添加以上属性,但是没有什么作用。
最后我将myeclipse中发布到WebSphere中的war包,去安装后,该问题消失了,一切访问都没问题。
比对一下里边的包,发下tomcat的war包多了三个jar包jsf-api.jar,jsf-impl.jar,jstl-1.2.jar,不管三七二十一,先删了再说,再次安装到WebSphere问题没在出现。
再次查看以前的错误信息原来说的是jsf-impl.jar包中的com.sun.faces.application.WebappLifecycleListener与java.util.EventListener不兼容导致。