Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
715 views
in Technique[技术] by (71.8m points)

jsf - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...