[
https://issues.apache.org/jira/browse/MYFACES-3629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16578895#comment-16578895
]
Bill Lucy commented on MYFACES-3629:
------------------------------------
I've been able to reproduce this on the 2.3 release. A possible fix is in the
linked PR.
I'm actually not sure if we even need to check for the presence of a faces
servlet mapping in AbstractFacesInitializer.initFaces() - in my testing,
behavior is the same when that check is removed completely. (Except of course
we don't have this issue with web fragments when the initFaces check is
removed!) The PR I've provided is taking a safe route and not getting rid of
that initFaces check, but if anyone with a better understanding of the history
of that code thinks it's OK to remove let me know.
> StartupServletContextListener crashes if FacesServlet is defined in
> web-fragments.
> ----------------------------------------------------------------------------------
>
> Key: MYFACES-3629
> URL: https://issues.apache.org/jira/browse/MYFACES-3629
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.1.9
> Reporter: Mark Struberg
> Assignee: Bill Lucy
> Priority: Major
>
> I'm trying to move all my common web.xml content from my 12 webapps in an EAR
> into a web-fragment.xml which gets referenced.
> MyFaces fails with the following Exception if the FacesServlet is defined in
> a web-fragment rather than web.xml:
> >If you did that and find nothing, the mistake might be due to the fact that
> >you use some special
> >web-containers which do not support registering context-listeners via TLD
> >files and a context listener is not
> > setup in your web.xml.
> > A typical config looks like this;
> > <listener>
> >
> > <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
> > </listener>
> In general the StartupServletContextListener defined in JSF-2.1 is pure PITA
> as it does crash apps which do not have any JSF content at all!.
> We should scan if we either find a faces-config.xml or any *.xhtml files in
> the app and if not we shall not start JSF.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)