[jboss-jira] [JBoss JIRA] (WFLY-3234) Wrong JSF class loaded in third dependencies

Farah Juma (JIRA) issues at jboss.org
Wed Apr 9 10:38:13 EDT 2014


    [ https://issues.jboss.org/browse/WFLY-3234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12960534#comment-12960534 ] 

Farah Juma commented on WFLY-3234:
----------------------------------

Note that this is a known Mojarra issue:

https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1257

As mentioned in the above issue, the FaceletContext.FACELET_CONTEXT_KEY constant will hopefully no longer be inlined by the compiler in JSF 2.3. 
                
> Wrong JSF class loaded in third dependencies
> --------------------------------------------
>
>                 Key: WFLY-3234
>                 URL: https://issues.jboss.org/browse/WFLY-3234
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JSF
>    Affects Versions: 8.0.0.Final, 8.0.1.Final
>         Environment: WildFly 8.0.0.Final or 8.0.1.Final-SNAPSHOT (20140408)
>            Reporter: Janario Oliveira
>            Assignee: Farah Juma
>            Priority: Critical
>              Labels: jsf22
>         Attachments: web-test-war-src.zip, web-util-jar-src.zip
>
>
> I have a web project, war, who use a third maven dependency which load java ee 6 dependency with provided scope:
> <dependency>
>             <groupId>javax</groupId>
>             <artifactId>javaee-web-api</artifactId>
>             <version>6.0</version>
>             <scope>provided</scope>
> </dependency>
> In runtime the third dependency tries to load a FaceletContext and to ensure compatibility it uses the constant from javax.faces.view.facelets.FaceletContext.FACELET_CONTEXT_KEY which fails because the constant returns the old constant from java ee 6 version, com.sun.faces.facelets.FACELET_CONTEXT instead of javax.faces.FACELET_CONTEXT from java ee 7.
> If I try the same code from a class in war project it loads the right constant and works.
> E.g.
> public FaceletContext getFaceletContext() {
>         final FacesContext currentInstance = FacesContext.getCurrentInstance();
>         return (FaceletContext) currentInstance.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
> //from third dependency "com.sun.faces.facelets.FACELET_CONTEXT"
> //from classes in war "javax.faces.FACELET_CONTEXT" 
> }
> I've created it with critical priority because it broke compatibility with some jsf frameworks.
> Attached the project where I could simulate

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list