Thomas Andraschko created TOMEE-2846:
----------------------------------------

             Summary: MyFaces AUTOMATIC_EXTENSIONLESS_MAPPING doesnt work 
                 Key: TOMEE-2846
                 URL: https://issues.apache.org/jira/browse/TOMEE-2846
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 8.0.2
            Reporter: Thomas Andraschko


MyFaces has a feature to automatically server all views without .xhtml:
index.xhtml -> index

this is implemented in the AbstractFacesInitializer and can be activated via:
org.apache.myfaces.AUTOMATIC_EXTENSIONLESS_MAPPING = true

This currently throws the following exception:

{code:java}
java.lang.UnsupportedOperationException: Section 4.4 of the Servlet 3.0 
specification does not permit this method to be called from a 
ServletContextListener that was not defined in web.xml, a web-fragment.xml file 
nor annotated with @WebListener
        at 
org.apache.catalina.core.StandardContext$NoPluggabilityServletContext.getServletRegistrations(StandardContext.java:6579)
        at 
org.apache.myfaces.webapp.AbstractFacesInitializer.getFacesServletRegistration(AbstractFacesInitializer.java:834)
        at 
org.apache.myfaces.webapp.AbstractFacesInitializer.initAutomaticExtensionlessMapping(AbstractFacesInitializer.java:820)
        at 
org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:246)
        at 
org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:103)
        at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4683)
{code}


It actually works without TomEE on plain Tomcat, as MyFaces adds the 
StartupServletContextListener via his own web-fragment in the myfaces-impl jar.
This is not scanned in TomEE and the StartupServletContextListener is added 
manually in:

https://github.com/apache/tomee/blob/master/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEMyFacesContainerInitializer.java#L96

Could we fix it by fake it in Tomcat somehow, that the listener was added via 
XML?




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to