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

Janario Oliveira (JIRA) issues at jboss.org
Tue Apr 8 21:34:13 EDT 2014


Janario Oliveira created WFLY-3234:
--------------------------------------

             Summary: Wrong JSF class loaded
                 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


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