Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
4.0.0-RC1, 2.3.10, 2.3-next-M7, 3.0.2
-
None
-
None
Description
If an application uses a custom factory via META-INF/services (such as javax.faces.application.ApplicationFactory), then a purge failure can occur when in development mode when an update occurs to the faces-config.xml. Additionally, the server must not restart the application (which can occur).
java.lang.IllegalArgumentException: object is not an instance of declaring class … at java.lang.reflect.Method.invoke(Method.java:508) org.apache.myfaces.config.FacesConfigurator.purgeConfiguration(FacesConfigurator.java:555) at org.apache.myfaces.config.FacesConfigurator.update(FacesConfigurator.java:485) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:136)
Code where the exception can occur: https://github.com/apache/myfaces/blob/e9fe59f96410f31a7f5c0fbd6838c1a22683a691/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java#L452-L456
getPurgeMethod unwraps the factory to get the method, but it then calls the private method on the wrong class ( which doesn't have that purge method)
Attachments
Issue Links
- links to