[ 
https://issues.apache.org/jira/browse/MYFACES-4442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17584214#comment-17584214
 ] 

Paul Nicolucci commented on MYFACES-4442:
-----------------------------------------

[~tandraschko] the Servlet 6.0 Specification relaxed these restrictions a bit 
but it wasn't removed from the getServletRegistration(s) methods: 
[https://github.com/jakartaee/servlet/issues/416] I can start a discussion on 
the mailing list and create an issue in the Servlet community for further 
discussion but it isn't going to change at this point in time for Jakarta EE10 
(Faces 4.0) so I think we're going to be stuck with this behavior until it is 
changed in the Servlet specification.

Servlet issue I created for this: 
[https://github.com/jakartaee/servlet/issues/470]

> UnsupportedOperationException when calling getServletRegistrations
> ------------------------------------------------------------------
>
>                 Key: MYFACES-4442
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4442
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 4.0.0-RC1
>            Reporter: Paul Nicolucci
>            Assignee: Paul Nicolucci
>            Priority: Major
>             Fix For: 4.0.0-RC2
>
>
> We're starting work to integration MyFaces 4.0 into the Open Liberty runtime. 
> I've run into the following UnsupportedOperationException:
> SRVE9002E: You cannot start this operation from a programmatically added 
> listener when using servlet-3.1 feature. (Operation: getServletRegistrations 
> | Listener: org.apache.myfaces.webapp.StartupServletContextListener | 
> Application: SimpleTest)
> Regardless of what the error says Servlet 6.0 is being used so that is not 
> important. In Open Liberty we automatically add the 
> org.apache.myfaces.webapp.StartupServletContextListener programmatically for 
> applications we determine to be "Faces enabled".
>  
> Previously we did not have this issue because of the following interface 
> method: 
> https://github.com/apache/myfaces/blob/3.0.x/impl/src/main/java/org/apache/myfaces/spi/WebConfigProvider.java#L50
> The method was removed in MyFaces 4.0.0.RC1 and that puts us into the 
> position I'm seeing with the UnsupportedOperationException since according to 
> the Servlet API you can not call getServletRegistrations from a 
> programmatically added listener:
> https://jakarta.ee/specifications/servlet/6.0/apidocs/jakarta.servlet/jakarta/servlet/servletcontext#getServletRegistrations()
> I'd like to add the removed method back to the interface and use it as a fall 
> back to allow folks to do as they have in the past when integrating MyFaces 
> into their runtime.
> I'll have a PR up this week for review of a proposed solution!
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to