GlassFish itself already ships with JSF bundled which get by default classloading precedence over the one bundled in the webapp. You basically need to tell GlassFish to use the webapp bundled JSF instead.
Edit the webapp's /WEB-INF/glassfish-web.xml
(or /WEB-INF/sun-web.xml
if you're using one of the first GF3 versions) to add the following two entries:
<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />
GlassFish will then use the webapp bundled JSF instead.
Alternatively, if you have full admin control over GlassFish, then you can also copy it in the /glassfish/modules
directory, replacing the older version, so that it get applied on all webapps.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…