• 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

JBOSS ERROR - "Both MyFaces and the RI are on your classpath."

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I jave JEE application which is deployed as ".ear" file into jboss-5.1.0.GA
My application uses JSF with SEAM 2.1.2 implementation, RichFaces 3.3.2.SR1 (you can see the full jar list in the attachment file).
I don't use any where in my code any of MyFaces/tomahawk tags. (as you can see in my web.xml configurations bellow).
This server has becide of my application, another application that uses MyFaces implementation of JSF.
uploading the server has no Errors but after my first access to my app, the server throws this error:
I will appreciate if any one has solution for that.
Thanks



Here is also my web.xml configuration:
Filename: jar_list.bmp
Description: Jars List of my application
File size: 983 Kbytes
 
Saloon Keeper
Posts: 27762
196
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
Unlike Tomcat, recent releases of JBoss are JEE-compliant, and that means that the JSF implementation is in the server itself, so it doesn't have to be added to the application's WAR.

If you want to use MyFaces despite this fact, there's a web.xml setting that tells JBoss to allow it. Check the JBoss documentation for details.

Note that "MyFaces" means only the MyFaces JSF core in this context. It's perfectly fine to use the JBoss (RI) faces implementation with MyFaces Tomahawk, and hopefully by now they've fixed the issues that made it not work well with Trinidad and Tobago.
 
Yaron Rel
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.
my application uses Jboss Seam that requires JSF RI (which JBOSS already holds) and not MyFaces.
I don't hold in my ".ear" file any JSF implementation because I want my application to use those of JBOSS.
When I run my app without any other app every thing goes well.
The problem starts when the other application that run on the same JBOSS (without ear file, just a folder) uses MyFaces
and then there is a conflict in the class loaders that causes my exception.
I need a way to force JBOSS to use it's JSF RI jars for my application instead of using the MyFaces jars of the other application for my application.
In the meanwhile I found some clues that might solve this:
1. The other application should be packed in ".ear" file and that the MyFaces jars will be part of the ".ear" file.
2. consider using "hierarchical classloader" (or Isolation) with JBoss (jboss-app.xml, jboss-web.xml). see also: http://community.jboss.org/wiki/ClassLoadingConfiguration
3. add the following to my application web.xml (but this wasn't enough):

 
Tim Holloway
Saloon Keeper
Posts: 27762
196
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
This doesn't sound quite right. Each webapp in a J(2)EE container has its own classpath, and anything in the WEB-INF/lib and WEB-INF/classes of one webapp will not appear in the classpath of any other webapp. That's true regardless of whether you deploy WARs or EARS and whether you keep them zipped or exploded.

You can have a conflict in JSF implementations in one webapp, but that shouldn't cause conflicts in other webapps, because the implementation jar is in not in their classpaths. The only way to have a global conflict is if you put classes in the globally-shared part of the classpath, which doesn't include the internal classpaths for individual webapps.
 
Yaron Rel
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thats what I think that should be, but the fact is that when I put asside the other app jars every think works fine.
also, the only place that the MyFaces jars can come from in JBOSS is only from other application because JBOSS default implementation of JSF is JSF RI and not those of apache MyFaces.
Yaron
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic