监听器“com.sun.faces.config.ConfigureListener”已为此上下文配置。重复的定义已被忽略 [英] The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored
问题描述
运行我的应用程序时收到以下信息:
i am getting the following info when running my application:
The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
我想知道这种错误的原因是什么?
and i want to know what is the cause for such error ?
推荐答案
首先,这是警告,而不是错误。差异非常大。 Web应用程序可以继续运行。警告仅仅是告知开发人员与预期/自然行为不同的情况,这些行为不一定会破坏功能。这对于开发人员不了解配置和/或其后果的情况非常有用。
First of all, this is a warning, not an error. The difference is pretty huge. The web application can just continue to run. Warnings are merely to inform the developer about circumstances which are different from expected/natural behaviours which does not necessarily break the functionality. This is very useful for the case that the developer was not aware about the configuration and/or its consequences.
该侦听器通常由JSF TLD文件自动注册,并且 ServletContainerInitializer
。如果您实际显式在webapp的 web.xml
中注册了相同的侦听器,则可以收到此警告消息。
That listener is usually auto-registered by JSF TLD file and the ServletContainerInitializer
. You can get this warning message if you have actually explicitly registered the very same listener in your webapp's web.xml
.
此警告不会造成伤害。它基本上告诉您,您不需要在webapp的 web.xml
中为特定目标servlet容器显式注册侦听器。您可以安全地从webapp的 web.xml
中删除有问题的< listener>
条目。
This warning does not harm. It is basically telling you that you don't need to explicitly register the listener in your webapp's web.xml
for the particular target servlet container. You could safely remove the <listener>
entry in question from the webapp's web.xml
.
但是,在某些情况下必须进行显式注册,例如当webapp被部署到一个错误的servlet容器时,该容器没有从TLD正确加载监听器, /或不支持 ServletContainerInitializer
。
However, explicit registration is mandatory in some circumstances such as when the webapp is intented to be deployed to a buggy servlet container which does not properly load the listener from the TLD and/or does not support the ServletContainerInitializer
.
- could not find Factory: javax.faces.context.FacesContextFactory
这篇关于监听器“com.sun.faces.config.ConfigureListener”已为此上下文配置。重复的定义已被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!