• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF 2.0 and websphere 6.x

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

I have a localhost (websphere 6.1.0.23) and a production (websphere 6.1.0.17) 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(FactoryFinder.java:804)



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: http://www.denoo.info/2008/02/finally-jsf-12-and-facelets-on-websphere-61/
Reference 2: http://javawords.com/2009/06/05/using-jsf-12-with-facelets-on-google-app-engine-for-java/
Reference 3: http://forums.java.net/jive/message.jspa?messageID=165925 (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): http://wiki.apache.org/myfaces/Websphere_Installation


Please, help to solve this problem!

Thanks!

Regards,
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 manifest.mf 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
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

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

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

Regards,
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic