Paul Nicolucci created MYFACES-4442:
---------------------------------------
Summary: 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
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|http://example.com/]
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()|http://example.com/]
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)