This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Both MyFaces and the RI are on your classpath.

 
Ranch Hand
Posts: 101
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting the following error when i tried to use the MyFaces implementation of JSF.
Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
Even after changing the class loading policy of war to ParentLast too the problem persists.
Can anybody suggest a solution for this?
 
Saloon Keeper
Posts: 25455
178
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Shasi Y",

Welcome to the JavaRanch! We don't have many rules around here, but we do require that you use a proper display name. Could you correct it, please? Information on what we need can be found at http://www.javaranch.com/name.jsp

You didn't say so, but you're probably trying to run JSF on JBoss. JBoss has a copy of the JSF RI built into it. You can find detailed information on this problem by doing a Google search, although I think the JBoss website has something on how to handle it as well.

Basically, you have to either override the use of MyFaces core or switch from MyFaces core to the Reference Implementation, which in JBoss mostly means removing the myfaces jsf-impl.jar from your WAR and letting the builtin RI classes handle the JSF core tag functionality. Since they're part of the standard, any core classes should be equivalent regardelss of whether it's MyFaces or the Sun RI.

If you're using Tomahawk or one of the other MyFaces advanced features, they stay the same. Only the core tag jar is a problem.
 
Shasi Mitra
Ranch Hand
Posts: 101
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response.
We are using myfaces framework in an application deployed in WAS 6.0 server.

WAS 6.0 library files already has a jar w.r.t JSF implementation and its provided by SUN-RI. Hence when the server gets started SUN-RI implementation is loaded in the classpath.

Since our application is using Apache Myfaces implementation, we have loaded the respective myfaces library files are loaded in WEB-INF/lib folder and set "PARENT_LAST" for our webmodule to make sure the apache myfaces jar always comes first in the classpath.

But on starting the application we get the following error-
"Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations".

In spite of the above error we were able to launch our application and screens without any issues.
My concern is whether we will end up having some issue in future since we have two JSF implementation jars in our classpath. Whether any of you have used Myfaces in websphere 6.0? Is there a work around such a way that only apache myfaces jar reside in the classpath. Note that modifying websphere libraray or using share library path is ruled out as our websphere server is used by multiple applications
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shasi, My application set up is exactly like yours and I get that warning message too but only when the first JSF page is requested. My app has been running for almost 2 years with no issues at all other than this warning. I would like to hear from others how they eliminated it.
 
Shasi Mitra
Ranch Hand
Posts: 101
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Dusi,
This question is unrelated to the one I posted before..Do you think MyFaces is better than Sun's Reference Implementation?
 
Tim Holloway
Saloon Keeper
Posts: 25455
178
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I didn't reply to your private email. Yesterday was busy. I really prefer to give answers on the JavaRanch, though where everyone can benefit from the knowledge.

I believe that since it's part of the JEE spec, the JSF core class implementations are required to be provided by the server, so the answer is the same as for JBoss. Simply don't include the myfaces-impl.jar in your WAR and let the server provide the implementation. If you're testing on Tomcat and deploying on WAS or JBoss, you'll need 2 different builds (or to add the MyFaces implementation to the server lib directory).

I avoided the Sun RI for quite a long while, because it didn't seem to be fully functional, but the recent versions are OK, and some say its better than MyFaces. I haven't done any serious studies of reliability or performance, but I'm now happy with the Sun RI.
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic