简体   繁体   English

在Websphere 6.1上运行Primefaces(JSF2)应用程序

[英]Running Primefaces (JSF2) application on Websphere 6.1

I have been attempting to get my Primefaces based web application to run on the customer's WAS 6.1.0.23 machine. 我一直在尝试使基于Primefaces的Web应用程序在客户的WAS 6.1.0.23计算机上运行。 I have tried both the reference and Myfaces implementations of JSF2, the latter of which has instructions for install on this specific server version ( http://wiki.apache.org/myfaces/Websphere_Installation ). 我已经尝试了JSF2的参考实现和Myfaces实现,后者均具有在此特定服务器版本( http://wiki.apache.org/myfaces/Websphere_Installation )上的安装说明。

I have included the necessary libraries (listed below for each implementation individually) in the .war file of the application. 我在应用程序的.war文件中包含了必要的库(下面分别列出了每个实现)。

The reference implementation 参考实现

  • primefaces-5.0.jar primefaces-5.0.jar
  • jstl-api.jar jstl-api.jar
  • jstl-impl.jar (both 1.2.2) jstl-impl.jar(均为1.2.2)
  • el-api-2.2.jar el-api-2.2.jar
  • el-impl-2.2.jar el-impl-2.2.jar
  • el-ri-1.0.jar el-ri-1.0.jar
  • javax.faces.jar javax.faces.jar
  • JDK 1.5 JDK 1.5

The Myfaces implementation Myfaces实施

  • commons-beanutils-1.8.3.jar commons-beanutils-1.8.3.jar
  • commons-collections-3.2.jar commons-collections-3.2.jar
  • commons-codec-1.3.jar commons-codec-1.3.jar
  • commons-digester-1.8.jar commons-digester-1.8.jar
  • commons-el.jar/(el-api-2.2.jar, el-impl-2.2.jar, el-ri-1.0.jar) [tried both, only the latter seems to be recognized] commons-el.jar /((el-api-2.2.jar,el-impl-2.2.jar,el-ri-1.0.jar))[尝试两者,似乎只有后者被认可]
  • myfaces-api-2.1.1 myfaces-api-2.1.1
  • myfaces-bundle-2.1.17.jar myfaces-bundle-2.1.17.jar
  • myfaces-impl-2.1.17.jar myfaces-impl-2.1.17.jar
  • JDK 1.5 JDK 1.5

I have set the application to load classes application first. 我已将应用程序设置为首先加载类应用程序。

Enterprise Applications > MyWebApp_war > Manage Modules > MyWebApp.war
Class loader order:
Classes loaded with application class loader first

When using the reference implementation, I progressively added necessary libraries to the .war file until I got an exception that I could not get around. 使用参考实现时,我逐步将必需的库添加到.war文件,直到遇到无法解决的异常。

[7/9/15 16:09:42:909 EDT] 00001183 WebApp        E   Exception caught while initializing context
java.lang.RuntimeException: java.lang.NoClassDefFoundError: java/util/ServiceLoader
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:280)
at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:652)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:355)
at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:292)
at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:92)
at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:671)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:624)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1274)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1138)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:817)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1461)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4132)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4229)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1466)
at sun.reflect.GeneratedMethodAccessor789.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:243)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1073)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:954)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1106)
...

With the Myfaces implementation, the same process was followed. 使用Myfaces实现,遵循相同的过程。 However, it was not able to start the application with the commons-el.jar. 但是,它无法使用commons-el.jar启动应用程序。 So, switching it out for el-api-2.2.jar, el-impl-2.2.jar, and el-ri-1.0.jar produced a result where the application would start, and catch a NameNotFoundException on the JSTL namespace 因此,将其切换为el-api-2.2.jar,el-impl-2.2.jar和el-ri-1.0.jar会产生一个结果,该结果将启动应用程序,并在JSTL名称空间上捕获NameNotFoundException

Warning: The page /template/common/commonLayout.xhtml declares namespace http://xmlns.jcp.org/jsf/core and uses the tag f:view , but no TagLibrary associated to namespace.

The following snippet is of the addition to WEB-INF/web.xml that changed to using the provided expresion language implementation. 以下代码段是WEB-INF / web.xml的补充,已更改为使用提供的表示语言实现。 It is followed by a System out dump. 随后是系统输出转储。

<context-param>
    <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
<context-param>
    <param-name>com.sun.faces.expressionFactory</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>

Sorry, the SystemOut.log is too long to paste directly: http://pastebin.com/JQ2br2Dq 抱歉,SystemOut.log太长,无法直接粘贴: http : //pastebin.com/JQ2br2Dq

So, my question is, has anyone successfully gotten a JSF2-based (Primefaces) web application to run on WAS 6.1, and what are the step-by-step instructions to do so? 因此,我的问题是,是否有人成功获得了基于JSF2的(Primefaces)Web应用程序以在WAS 6.1上运行,并且逐步说明是什么? Thank you very much for your help. 非常感谢您的帮助。

Also, NB this application is known working on all Apache Tomcat versions that support JSF2. 另外,请注意,此应用程序可用于支持JSF2的所有Apache Tomcat版本。

WebSphere Application Server only supports Java 5, but the error indicates that the JSF implementation ( com.sun.faces.config.ConfigureListener ) requires Java 6 since it is attempting to use java.util.ServiceLoader , which was only added in that version. WebSphere Application Server仅支持Java 5,但是该错误表明JSF实现( com.sun.faces.config.ConfigureListener )需要Java 6,因为它试图使用java.util.ServiceLoader ,而该java.util.ServiceLoader仅在该版本中添加。 You'll either need to pick an older JSF implementation or a newer WebSphere Application Server version (note that 6.1 was end of service as of 2013). 您可能需要选择一个较旧的JSF实现或一个较新的WebSphere Application Server版本(请注意6.1从2013年开始停止服务)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM