How to update Mojarra version in GlassFish

本秂侑毒 提交于 2019-11-26 08:19:40

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/10782528/how-to-update-mojarra-version-in-glassfish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!