Volodymyr Siedlecki created MYFACES-4469:
--------------------------------------------

             Summary: "java.lang.IllegalArgumentException: object is not an 
instance of declaring class" occurs inFacesConfigurator.purgeConfiguration 
                 Key: MYFACES-4469
                 URL: https://issues.apache.org/jira/browse/MYFACES-4469
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 3.0.2, 2.3-next-M7, 2.3.10, 4.0.0-RC1
            Reporter: Volodymyr Siedlecki


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 and an update occurs to the faces-config.xml. 



{code:java}
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}


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 unwrap the factories, but it can then call the private method on 
the wrong class ( which doesn't have that purge method)



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

Reply via email to