5
votes

I am trying to deploy an application on Websphere 8.5.5 I've created a shared library for Websphere that includes myfaces 2.2 jars and other dependencies like commons-collections.
I also made the class loader of my application as PARENT_LAST.
When I deploy the application, I get this exception:

An error occured while initializing MyFaces: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
java.lang.IllegalArgumentException: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:557)
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:524)
1
The mentioned procedure works fine with Mojarra 2.2. I am using a shared library containing only: jsf-api-2.2.4 and jsf-impl-2.2.4 - Laabidi Raissi
How are you attaching the shared library? are you attaching it to the server instance, or to the application? - Isaac
Environment/Shared libraries/New - Laabidi Raissi
and in the application: Shared library references/and add the shared library from the list - Laabidi Raissi
Did you set the Shared Library as an isolated one? - Isaac

1 Answers

1
votes

I was looking at running a newer version of MyFaces on WAS 8.5.5, and ran into a similar issue. It appears to be a conflict between the code IBM wrote to support its embedded version of MyFaces, and an application- or shared library-provided MyFaces.

IBM provides a way to circumvent this issue. When WAS 8.0 shipped, it provided a feature to allow select either "SunRI1.2" or "MyFaces" as the server-provided JSF. Setting the default to "SunRI1.2" would remove the server-provided MyFaces from the classpath and allow the developer to provide their own.

  1. Select any application
  2. Click JSP and JSF Options
  3. In the JSF implementation section, change the drop-down to SunRI1.2
  4. Click OK
  5. Save configuration and restart server