shreekanth
shreekanth

Reputation: 489

JSF2 and primefaces 3.4 on Websphere 8

I have created web dynamic project with jsf2, Primefaces 3.4, Tomcat7.Application runs fine. If i deploy the EAR of the same project on Websphere8 instead of Tomcat7, I am getting Exceptions.I am not sure of what is happening. I am new to JSF2 and Wepshere8.

can you provide me the links on how to start sample jsf2 + primefaces project on Websphere 8

Thanks in advance.

Upvotes: 3

Views: 6582

Answers (4)

Prasobh.Kollattu
Prasobh.Kollattu

Reputation: 1701

I too faced the same problem. Websphere by default support sun impl and apache myfaces and its jsf 1.2.

To use jsf 2 implementation.

1.Make sure to remove servlet.jar from your application.Its need for tomcat however not in websphere.

2.Change the classloader policy for ear to parent last.Parent last means lib in your app will have higher priority.if not found will load from WAS class path.

3.Also make sure to change the webmodule class loader policy to parent last.

4.Restart websphere.

Upvotes: 1

gopal barik
gopal barik

Reputation: 11

For using different implementations of JSF, the WebSphere Application Server JSF engine determines if the SUN RI or Apache MyFaces is used from the application server run time. After the JSF engine determines the implementation that is used, the correct listener class is registered with the web container. You do not need to add the com.sun.faces.ConfigureListener or the org.apache.myfaces.StartupConfigureListener to the web.xml file.

http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/cweb_javaserver_faces.html

Please see above...

Upvotes: 1

user2506035
user2506035

Reputation: 1

To solve the classloader of primefaces in websphere 8.5 classes replace the jsf jsf-api jsf-impl javaee-api for the native implementation of websphere myfaces-api myfaces-impl

Upvotes: -2

Harish Raj
Harish Raj

Reputation: 1575

Got it. Try to add com.sun.faces.config.ConfigureListener instead of org.apache.myfaces.webapp.StartupServletContextListener in your web.xml, restart your server and then run it.

The code should look like the following.

<listener>  
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>  
</listener> 

Upvotes: 1

Related Questions