webtier@glassfish.java.net

Re: [webtier] WEB-INF/lib/jsf_impl.jar ignored by Sun Application Server 9.1_02

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Thu, 21 Jan 2010 09:46:22 -0800

On 01/21/10 03:16 AM, webtier_at_javadesktop.org wrote:
> Hello everybody!
>
> I have a problem using Mojarra 1.2_13-b01-FCS on Sun Java System Application Server 9.1_02 (which is included in Java EE 5 SDK Update 6). I already created the necessary sun-web.xml with 'useMyFaces' parameter set to true and added jsf_api.jar and jsf_impl.jar to WEB-INF/lib.
> But the application server log entry "Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/foo'" indicates that JSF 1.2_04 is still loaded for my application. BUT WEB-INF/lib/jsf_impl.jar (which is 1.2_13) seems to be loaded in some way because calls to the JSF API apply to bug fixes introduced with 1.2_13. By the way when setting useMyFaces to false in sun-web.xml those API calls do not conform to bug fixes done in 1.2_13. Thus I conclude that useMyFaces=true causes that 1.2_13 is loaded for some parts of the application although the log still indicates that 1.2_04 is loaded. However the application does not work with this configuration. The only way I managed to run the application was to delete jsf_impl.jar from the server's lib directory. Doing that also the log indicates that 1.2_13 is loaded for my application.
>
> It seems that Sun Java System Application Server 9.1_02 always uses the jsf-impl.jar in its lib directory. Is there a way to change this behavior despite of deleteing the the jar in the lib directory?
>

In addition to setting "useMyFaces" to true, you also need to disable
classloader delegation, by adding this line to your sun-web.xml:

  <class-loader delegate="false"/>

In summary, your sun-web.xml should look like this:

<sun-web-app>
 <class-loader delegate="false"/>
 <property name="useMyFaces" value="true"/>
</sun-web-app>


Jan

> Thanks in advance,
> R
> [Message sent by forum member 'robsta10' (robert.moestl_at_joanneum.at)]
>
> http://forums.java.net/jive/thread.jspa?messageID=382123
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>