File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes JSF 2.0 and websphere 6.x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF 2.0 and websphere 6.x" Watch "JSF 2.0 and websphere 6.x" New topic

JSF 2.0 and websphere 6.x

Bertjan Underhill

Joined: Aug 25, 2008
Posts: 12

I'm trying to run an web application on websphere using jsf 2.0 + facelets + jstl.

I have a localhost (websphere and a production (websphere environment.
Localhost works fine but production not.

When I start the EAR on production i get the following error:
3/11/10 9:38:02:208 CET] 0000003b WebGroup A SRVE0169I: Loading Web Module: sun_jsf_20.
3/11/10 9:38:06:126 CET] 0000003b config I Initializing Mojarra 2.0.1 (FCS b02) for context 'sun_jsf_20'
3/11/10 9:38:19:517 CET] 0000003b config I Unsanitized stacktrace from failed start...
com.sun.faces.config.ConfigurationException: Factory 'javax.faces.context.FacesContextFactory' was not configured properly.


3/11/10 9:38:19:707 CET] 0000003b WebApp E Exception caught while initializing context
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! argument type mismatch


3/11/10 9:38:19:845 CET] 0000003b ServletWrappe E SRVE0100E: Did not realize init() exception thrown by servlet Faces Servlet: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(

When setting up localhost I changed the classloader from the application deployment descriptor of the EAR to classloader mode: PARENT_LAST and WAR classloader policy: APPLICATION.
I also create the following files in the directory Webcontent - META-INF to get rid off the FacesContextFactory error:
- javax.faces.application.ApplicationFactory with content: com.sun.faces.application.ApplicationFactoryImpl
- javax.faces.context.FacesContextFactory with content: com.sun.faces.context.FacesContextFactoryImpl
- javax.faces.lifecycle.LifecycleFactory with conent: com.sun.faces.lifecycle.LifecycleFactoryImpl
- javax.faces.render.RenderKitFactory with content: com.sun.faces.renderkit.RenderKitFactoryImpl
Reference 1:
Reference 2:
Reference 3: (Posted: Oct 30, 2006 2:18 AM by smlp)

When setting up production I changed class loader order to "Classes loaded with application class loader first". The META-INF is include the EAR.
Reference (Websphere 6.1 Installation Guide):

Please, help to solve this problem!



><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´¯`·.¸¸.·´¯`·.. ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>
Tom Fulton
Ranch Hand

Joined: Mar 30, 2006
Posts: 96
Running JSF in Websphere 6 can be challenging. I don't if there are additional configuration details necessary for JSF 2, but here are my notes about getting JSF 1.2 to run correctly in WAS 6:
1. Change the class loader in the EAR by selecting the application deployment descriptor and picking the “Deployment” tab. Scroll down until you see the “Application” entry at the bottom. Click on the plus sign next to the application so you can see the EAR and the web app, then select the Application. Specify the Classloader mode for the application as PARENT_LAST, and the classloader policy as APPLICATION. Next, select the web application. Specify the classloader mode as PARENT_FIRST (the WAR classloader policy will be grayed out)
2. Make sure the EAR libraries are being seen instead of the files on the server. Select the build path for the web application, then select the “Order and Export” tab. Make sure the EAR libraries are above the WAS 6.1 libraries (do this by selecting the EAR library and pressing the “Up” button until it’s above the WAS 6.1 libraries)
3. Make sure the manifest for the web project has selected all of the .jars from the EAR. Open in META-INF of the WebContent folder. Find the “Dependencies” section, then press “Select all” to ensure that the .jars from the EAR are included. Save your changes to the manifest.

As I said, I don't know if this will work...but it works for JSF 1.2.

For additional information about configuring JSF 2 to run in Tomcat (which might help) see this link: JSF 2 in Tomcat
Bertjan Underhill

Joined: Aug 25, 2008
Posts: 12

Thank you for the reply, I will try it this week.

I already have a tomcat with jsf 2.0 working.
So much easier!

I agree. Here's the link:
subject: JSF 2.0 and websphere 6.x
It's not a secret anymore!