users@glassfish.java.net

JSF 1.2_13 on glassfish 2.1

From: <glassfish_at_javadesktop.org>
Date: Wed, 08 Jul 2009 05:36:49 PDT

We are using glassfish2.1.<br/>
I'm trying to use the latest JSF (RI) version : 1.2_13 in our application.<p/>

I know I could be upgrading the version in the lib dir of the server (the admin console will probably work with _13 as well) but I'm trying to avoid this.<br/>
Its better if applications can decide on themselves which libraries they want.<p/>

I first tried to turn off class loader delegation via the sun-web.xml.<br/>
This is not a problem since the webapp is standalone and does not depend on other modules (such as ejbs etc). But no luck, the version output on startup is still the same as before:<p/>

[code]
Initializing Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context
[/code]
<p/>
Next I found a blog stating that one should put an additional property in the sunweb xml, so it would look like this:<p/>

[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
<sun-web-app>
<class-loader delegate="false"/>
<property name="useMyFaces" value="true"/>
</sun-web-app>
[/code]
<p/>
There is also a property 'useBundledJsf' but that is for glassfish 3 apparantly, and it would mean exactly the same but is a rename (useMyFaces should also work with any other custom JSF impl).<p/>

Again, no luck.<p/>

Next I tried to remove the 'jsf-impl' from the servers lib directory.<br/>
This means I got no admin console anymore, but just for testing.<br/>
After booting it printed the correct version of the jsf impl in the war.<p/>

So I can conclude that even with these settings the jsf impl from the parent classloader is used (weird, since delegation is turned off).<p/>

What is also weird, is that when I put the jsf-impl back to the lib dir of the server (and it prints 1.2_04 again) and I remove the jsf-impl from my WAR, it gives a ClassNotfoundException FacesContext, right after printing the version (1.2_04) . Why would this be, since its using the jsf-impl from the lib dir of the server ...and it did found some JSF classes since its printing its version...<p/>
[Message sent by forum member 'errorken' (errorken)]

http://forums.java.net/jive/thread.jspa?messageID=354633