Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update Mojarra version in GlassFish

I want to update my JSF application to use Mojarra version 2.1.8. I added these lines into the POM file of the WAR package:

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.faces</artifactId>
    <version>2.1.8</version>
</dependency> 

I also added the JSF repository. I package is build successfully with the Mojarra version 2.1.8. But when I open the GlassFish log I see that there is a Mojarra version 2.1.6 deployed. What am I missing? Do I need to make some configuration into the GlassFish server?

like image 377
user1285928 Avatar asked May 28 '12 09:05

user1285928


1 Answers

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.

like image 199
BalusC Avatar answered Nov 08 '22 19:11

BalusC