【发布时间】:2018-04-26 05:19:58
【问题描述】:
我正在尝试使用 jsf 2.2 创建一个 Web 应用程序。我的应用程序正在使用 JERSEY Restful、jre 1.8、JSF 2.2、Primefaces。
它在我的本地机器上工作得非常好,但在 AWS(EC2-Tomcat by bitnami-free tier)上我得到了错误(底部的错误日志。)
非常感谢您提前提供的帮助。
我正在使用以下库
这是我的 Web.xml 文件代码:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>MYAPP</display-name>
<welcome-file-list>
<welcome-file>welcome.jsf</welcome-file>
</welcome-file-list>
<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>*.jsf</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Jersey Rest Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Rest Service</servlet-name>
<url-pattern>/webresources/*</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
</web-app>
错误日志 2018 年 4 月 26 日 03:33:43.130 严重 [localhost-startStop-23] org.apache.catalina.core.StandardContext.listenerStart 向类 [com.sun.faces.config.ConfigureListener] 的侦听器实例发送上下文初始化事件的异常 java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 com.sun.faces.config.ConfigureListener.contextInitialized(未知来源) 在 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) 在 org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986) 在 org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) 引起:java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 org.primefaces.util.Jsf23Helper.addSearchKeywordResolvers(Jsf23Helper.java:27) 在 org.primefaces.webapp.PostConstructApplicationEventListener.processEvent(PostConstructApplicationEventListener.java:48) 在 javax.faces.event.SystemEvent.processListener(未知来源) 在 com.sun.faces.application.ApplicationImpl.processListeners(未知来源) 在 com.sun.faces.application.ApplicationImpl.invokeListenersFor(未知来源) 在 com.sun.faces.application.ApplicationImpl.publishEvent(未知来源) 在 com.sun.faces.config.ConfigManager.publishPostConfigEvent(未知来源) ... 14 更多
2018 年 4 月 26 日 03:33:43.463 严重 [localhost-startStop-23] org.apache.catalina.core.StandardContext.listenerStart 异常将上下文初始化事件发送到类 [com.sun.faces.config 的侦听器实例.ConfigureListener] java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 com.sun.faces.config.ConfigureListener.contextInitialized(未知来源) 在 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4743) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) 在 org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986) 在 org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) 引起:java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 org.primefaces.util.Jsf23Helper.addSearchKeywordResolvers(Jsf23Helper.java:27) 在 org.primefaces.webapp.PostConstructApplicationEventListener.processEvent(PostConstructApplicationEventListener.java:48) 在 javax.faces.event.SystemEvent.processListener(未知来源) 在 com.sun.faces.application.ApplicationImpl.processListeners(未知来源) 在 com.sun.faces.application.ApplicationImpl.invokeListenersFor(未知来源) 在 com.sun.faces.application.ApplicationImpl.publishEvent(未知来源) 在 com.sun.faces.config.ConfigManager.publishPostConfigEvent(未知来源) ... 14 更多
2018 年 4 月 26 日 03:39:45.299 严重 [localhost-startStop-24] org.apache.catalina.core.StandardContext.listenerStart 异常将上下文初始化事件发送到类 [com.sun.faces.config 的侦听器实例.ConfigureListener] java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 com.sun.faces.config.ConfigureListener.contextInitialized(未知来源) 在 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) 在 org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986) 在 org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) 引起:java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 org.primefaces.util.Jsf23Helper.addSearchKeywordResolvers(Jsf23Helper.java:27) 在 org.primefaces.webapp.PostConstructApplicationEventListener.processEvent(PostConstructApplicationEventListener.java:48) 在 javax.faces.event.SystemEvent.processListener(未知来源) 在 com.sun.faces.application.ApplicationImpl.processListeners(未知来源) 在 com.sun.faces.application.ApplicationImpl.invokeListenersFor(未知来源) 在 com.sun.faces.application.ApplicationImpl.publishEvent(未知来源) 在 com.sun.faces.config.ConfigManager.publishPostConfigEvent(未知来源) ... 14 更多
2018 年 4 月 26 日 03:39:45.716 严重 [localhost-startStop-24] org.apache.catalina.core.StandardContext.listenerStart 异常将上下文初始化事件发送到类 [com.sun.faces.config 的侦听器实例.ConfigureListener] java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 com.sun.faces.config.ConfigureListener.contextInitialized(未知来源) 在 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4743) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) 在 org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986) 在 org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) 引起:java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 org.primefaces.util.Jsf23Helper.addSearchKeywordResolvers(Jsf23Helper.java:27) 在 org.primefaces.webapp.PostConstructApplicationEventListener.processEvent(PostConstructApplicationEventListener.java:48) 在 javax.faces.event.SystemEvent.processListener(未知来源) 在 com.sun.faces.application.ApplicationImpl.processListeners(未知来源) 在 com.sun.faces.application.ApplicationImpl.invokeListenersFor(未知来源) 在 com.sun.faces.application.ApplicationImpl.publishEvent(未知来源) 在 com.sun.faces.config.ConfigManager.publishPostConfigEvent(未知来源) ... 14 更多
2018 年 4 月 26 日 04:57:18.310 严重 [localhost-startStop-25] org.apache.catalina.core.StandardContext.listenerStart 异常将上下文初始化事件发送到类 [com.sun.faces.config 的侦听器实例.ConfigureListener] java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 com.sun.faces.config.ConfigureListener.contextInitialized(未知来源) 在 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4743) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) 在 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) 在 org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986) 在 org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) 引起:java.lang.NoSuchMethodError: javax.faces.application.Application.addSearchKeywordResolver(Ljavax/faces/component/search/SearchKeywordResolver;)V 在 org.primefaces.util.Jsf23Helper.addSearchKeywordResolvers(Jsf23Helper.java:27) 在 org.primefaces.webapp.PostConstructApplicationEventListener.processEvent(PostConstructApplicationEventListener.java:48) 在 javax.faces.event.SystemEvent.processListener(未知来源) 在 com.sun.faces.application.ApplicationImpl.processListeners(未知来源) 在 com.sun.faces.application.ApplicationImpl.invokeListenersFor(未知来源) 在 com.sun.faces.application.ApplicationImpl.publishEvent(未知来源) 在 com.sun.faces.config.ConfigManager.publishPostConfigEvent(未知来源) ... 14 更多
【问题讨论】:
-
请改进你的标题
-
既然你用的是EC2,那你为什么不用Wildfly、Glassfish或者Wildfly-swarm这样的真正的应用服务器呢?
标签: jsf amazon-ec2 primefaces jsf-2.2