2

When org.apache.myfaces.CACHE_EL_EXPRESSIONS with value alwaysRecompile is in web.xml, WAR starts but when trying to go to any JSF view, this exception is thrown:

java.lang.NoSuchMethodException: org.apache.myfaces.view.facelets.AbstractFaceletCache.setMemberFactories(javax.faces.view.facelets.FaceletCache$MemberFactory, javax.faces.view.facelets.FaceletCache$MemberFactory)

Any ideas? WebSphere 9 is using MyFaces 2.2. Are there some limitations as compared to "usual" MyFaces 2.2 implementation?

Nikola
  • 554
  • 1
  • 4
  • 20

1 Answers1

2

I tested on 9.0.5.6 and also encountered the same error.

java.lang.NoSuchMethodException: org.apache.myfaces.view.facelets.AbstractFaceletCache.setMemberFactories(javax.faces.view.facelets.FaceletCache$MemberFactory, javax.faces.view.facelets.FaceletCache$MemberFactory)
    at java.lang.Class.newNoSuchMethodException(Class.java:567)
    at java.lang.Class.throwExceptionOrReturnNull(Class.java:1222)
    at java.lang.Class.getMethodHelper(Class.java:1308)
    at java.lang.Class.getDeclaredMethod(Class.java:936)
    at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.<init>(DefaultFaceletFactory.java:166)
    at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.createFaceletFactory(FaceletViewDeclarationLanguage.java:2233)

I see the code is trying to retrieve the setMemberFactories method with 2 args rather than 3 (as the exception indicates, too).

I'll create an issue and have this issue resolve in the next WAS 9 release cycle. Thanks for discovering this!

volosied
  • 151
  • 1
  • 6
  • I'm just worried it's not some 'between the lines' WAS limitation. They list just dozen of MyFaces config params at this link: https://www.ibm.com/docs/en/was-nd/9.0.5?topic=parameters-jsf-engine-configuration – Nikola Jan 12 '23 at 19:12
  • It's a developer mistake that's gone unnoticed as far as I can tell. If you need a workaround, you could use OpenLiberty's jsf-2.2 feature as I don't see this problem there. Or you use a third party library in WAS 9: https://www.ibm.com/docs/en/was-liberty/base?topic=22-configuring-third-party-javaserver-faces-implementations – volosied Jan 13 '23 at 14:51