Skip to main content

MyFaces + Tomahawk on Glassfish3.1.2 how to setup faces-config.xml correctly?

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2009-07-15

Using file-upload in my application, I plugged MyFaces-Tomahawk20 version 1.1.11 in.
It works, but on server startup I have Warnings which I don't like.
1.) Mojarra is initialized:
[#|2012-04-12T18:48:52.505+0200|INFO|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=17;_ThreadName=admin-thread-pool-4848(2);|Initializing Mojarra 2.1.6 (SNAPSHOT 20111206) for context '/MonteRosa'|#]
I know. Tomahawk can work on top of Mojarra, but for compatibility with other AS, I would like to use MyFaces only.
2. I have a lot of ClassNotFoundExceptions like:
[#|2012-04-12T18:48:53.894+0200|WARNING|glassfish3.1.2||_ThreadID=17;_ThreadName=admin-thread-pool-4848(2);|WEB9052: Unable to load class org.apache.myfaces.view.facelets.component.RepeatRenderer, reason: java.lang.ClassNotFoundException: org.apache.myfaces.view.facelets.component.RepeatRenderer|#]
[#|2012-04-12T18:48:53.895+0200|WARNING|glassfish3.1.2||_ThreadID=17;_ThreadName=admin-thread-pool-4848(2);|WEB9052: Unable to load class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRenderer, reason: java.lang.ClassNotFoundException: org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRenderer|#]
The tomahawk filter is defined within web.xml. As said above it works.
But, how can I tell Glassfish to use MyFaces instead of Mojarra and configure faces-config.xml, in a manner for all org.apache.myfaces-classes being found from the beginning?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-07-20

You can use a glassfish-web.xml file to tell it to use the classloader in
the war file instead of the default container classloader. See the
information below. The class-loader delegate="false" Check to see if this
works for you.

<?xml version="1.0" encoding="UTF-8"?>

* *

Keep a copy of the generated servlet class' java


John Yeary
*NetBeans Dream Team*
*President Greenville Java Users Group
Java Users Groups Community Leader
Java Enterprise Community Leader*


"Far better it is to dare mighty things, to win glorious triumphs, even
though checkered by failure, than to take rank with those poor spirits who
neither enjoy much nor suffer much, because they live in the gray twilight
that knows not victory nor defeat."