1 2 Previous Next 19 Replies Latest reply: Dec 4, 2013 7:06 PM by Bruno HALEBLIAN RSS

JBoss 7.1 - Migration to JSF 2.2

Abdur Rahman Newbie

Can someone list me steps for ugrading JBoss 7.1 to support JSF 2.2?

 

Thanks.

  • 1. Re: JBoss 7.1 - Migration to JSF 2.2
    Ove Ranheim Novice

    I'm wondering the same.

     

    @Redhattians, is there a way to try out JSF 2.2 M6 on AS7.1.1?

     

    Cheers,

    Ove

  • 2. Re: JBoss 7.1 - Migration to JSF 2.2
    Stan Silvert Master

    I planning to start looking at that this week. 

     

    Stay tuned.  I'll let you know as soon as I have something running.

     

    Stan

  • 3. Re: JBoss 7.1 - Migration to JSF 2.2
    Stan Silvert Master

    I got it running on both 7.1.1.Final and a build of 7.2.0.Alpha1.

     

    Here is what you need to do:

     

    Download the impl and api jars for Mojarra 2.2.  I got them from

    http://mvnrepository.com/artifact/com.sun.faces/jsf-impl

    http://mvnrepository.com/artifact/com.sun.faces/jsf-api

     

    Put the impl jar in <jboss_home>/modues/com/sun/jsf-impl/main

    Edit the module.xml in that directory and change the resource-root-path to the name of your impl jar.

     

    Put the api jar in <jboss_home>/modules/javax/faces/api/main

    Edit the module.xml in that directory and change the resource-root-path to the name of your api jar.

    Also in module.xml,  add this to the dependencies section:

    <module name="com.sun.jsf-impl"/>
    

     

    Unfortunately, jsf-api now depends on jsf-impl, which is wrong but it shouldn't hurt anything.

     

    Please let me know if you find any bugs.

     

    Stan

  • 4. Re: JBoss 7.1 - Migration to JSF 2.2
    Ove Ranheim Novice

    Stan, this is excellent news! Thanks

  • 5. Re: JBoss 7.1 - Migration to JSF 2.2
    robert walker Newbie

    stan, great instructions, thanks for taking time to write that up

     

    i really want to go 100% CDI, CODI didn't work out so good for me so now i am trying   jsf 2.2.

    It is supposed to have a CDI extension ( javax.faces.flow.ViewScoped ), a CDI compatible @ViewScoped

     

    i am trying the latest morajja jsf 2.2.0-m05 impl/api from your links above

     

    i have 1 webapp (using rf 4.2.3 and jee6 technologies) that is working great with jboss7 7.1.1final/morjarra 2.1.13

     

    i thought to myself, this is going to be easy now that i got these instructions, and i'll have my CDI viewscoped, GREAT!!!

     

    sooo,  I made a copy of my  jboss7.1.1.Final folder and renamed it    jboss-as-7.1.1.Final-WithJSF2.2.0-m05, clean out all prvious deployments/tmp dirs.

     

    then i followed your steps and tried to execute my app, no errors on startup but accessing my login page throws this stack trace

     

    would you hava any ideas on how I can get past this?

     

    this really would be the best router for me to take instead of fiddlingwith third party libs to get a 100% CDI web app , but the stack trace doesn't seem

    very useful

     

     

    ------------------------------------

     

    15:23:40,615 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/VDASJSF2.2-m05].[Faces Servlet]] (http--127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.AbstractMethodError  at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.startElement(HtmlResponseWriter.java:635) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at com.sun.faces.renderkit.html_basic.ScriptRenderer.startElement(ScriptRenderer.java:60) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at com.sun.faces.renderkit.html_basic.ScriptRenderer.encodeEnd(ScriptRenderer.java:106) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at org.richfaces.component.UITransient.encodeEnd(UITransient.java:236) [richfaces-core-impl-4.2.3.Final.jar:4.2.3.Final]
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) [jsf-api-2.2.0-m05.jar:2.2]
            at org.richfaces.renderkit.html.ResourceRenderer.encodeResource(ResourceRenderer.java:33) [richfaces-core-impl-4.2.3.Final.jar:4.2.3.Final]
            at org.richfaces.renderkit.html.ResourceLibraryRenderer.encodeEnd(ResourceLibraryRenderer.java:75) [richfaces-core-impl-4.2.3.Final.jar:4.2.3.Final]
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) [jsf-api-2.2.0-m05.jar:2.2]
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) [jsf-api-2.2.0-m05.jar:2.2]
            at com.sun.faces.renderkit.html_basic.HeadRenderer.encodeHeadResources(HeadRenderer.java:113) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at com.sun.faces.renderkit.html_basic.HeadRenderer.encodeEnd(HeadRenderer.java:100) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) [jsf-api-2.2.0-m05.jar:2.2]
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) [jsf-api-2.2.0-m05.jar:2.2]
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1850) [jsf-api-2.2.0-m05.jar:2.2]
            at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:425) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:329) [jsf-api-2.2.0-m05.jar:2.2]
            at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:329) [jsf-api-2.2.0-m05.jar:2.2]
            at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:202) [jsf-impl-2.2.0-m05.jar:2.2.0-m05-SNAPSHOT]
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:642) [jsf-api-2.2.0-m05.jar:2.2]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
            at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
            at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
            at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

     

     

     

    NOTE:  as a followup, i tried to get my webapp with rf 4.3 snapshot and 12/7/2012 morajja 2.2 and got past the exception, but have other exceptions

    popup during runtime, NPE and odd behavior when activating action listeners

  • 6. Re: JBoss 7.1 - Migration to JSF 2.2
    Stan Silvert Master

    Pavol Pitonak, from the RichFaces team, just mentioned that RichFaces doesn't work with Mojarra 2.2-m05.  You need to use the latest Mojarra2.2 SNAPSHOT.  I don't know if that will fix your problem but it's worth a try.

     

    Stan

  • 7. Re: JBoss 7.1 - Migration to JSF 2.2
    robert walker Newbie

    great!

     

    i went and got rf 4.3.0. SNAPSHOT and also morajja snapshot  jsf-impl/api-2.2.0-20121207.085158-193 and i can run the app

     

    but after clicking a few h:commandLinks i got NullPointerExceptions, and some views don't even render, and don't throw any exceptions to indicate something went wrong,

    so i guess some things still need to be worked out  :-( 

     

    I am looking forward to 100% CDI with jsf 2.2 and hope richfaces will have a release ready for it

     

    let me know if i can help with stacktraces or ...

     

     

     

    thanks jboss team!!

     

     

     

     

     

     

     

  • 8. Re: JBoss 7.1 - Migration to JSF 2.2
    atarifreak73 Newbie

    Great! Thank You für this simple and at once powerful solution!

  • 9. Re: JBoss 7.1 - Migration to JSF 2.2
    Abdur Rahman Newbie

    I revisted this issue last week and upgraded JBoss AS 7.1.1 to JSF-2.2.1 :

     

    (You can find jars with associated module.xml file in the attached file named "modules.zip")

     

    1.          servlet- api:

              a.          Backup existing files in <jboss_home>/modules/javax/servlet/api/main directory into some other directory (e.g, old-main)

              b.          Copy javax.servlet-api-3.0.1.jar into <jboss_home>/modules/javax/servlet/api/main directory

              c.          Create module.xml file inside <jboss_home>/modules/javax/servlet/api/main directory with the following contents:

     

     

              <?xml version="1.0" encoding="UTF-8"?>

              <module xmlns="urn:jboss:module:1.1" name="javax.servlet.api">

                        <resources>

                                  <resource-root path="javax.servlet-api-3.0.1.jar"/>

                        </resources>

              </module>

     

     

    2.          Jstl-api:

              a.           Backup existing files in <jboss_home>/modules/javax/servlet/jstl/api/main directory into some other directory (e.g, old-main)

              b.          Copy javax.servlet.jsp.jstl-api-1.2.1.jar into <jboss_home>/modules/javax/servlet/jstl/api/main directory

              c.          Create module.xml file inside <jboss_home>/modules/javax/servlet/jstl/api/main directory with the following contents:

     

     

              <?xml version="1.0" encoding="UTF-8"?>

              <module xmlns="urn:jboss:module:1.1" name="javax.servlet.jstl.api">

                        <dependencies>

                                  <module name="javax.api" export="false"/>

                                  <module name="javax.servlet.api" export="false"/>

                                  <module name="javax.servlet.jsp.api" export="false"/>

                                  <module name="org.apache.xalan" export="false"/>

                        </dependencies>

     

     

                        <resources>

                                  <resource-root path="javax.servlet.jsp.jstl-api-1.2.1.jar"/>

                        </resources>

              </module>

     

     

    3.          jsf-api:

              a.          Backup existing files in <jboss_home>/modules/javax/faces/api/main directory into some other directory (e.g, old-main)

              b.          Copy jsf-api-2.2.1.jar into <jboss_home>/modules/javax/faces/api/main directory

              c.          Create module.xml file inside <jboss_home>/modules/javax/faces/api/main directory with the following contents:

     

     

              <?xml version="1.0" encoding="UTF-8"?>

              <module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="main">

                        <dependencies>

                                  <module name="javax.el.api" export="true"/>

                                  <module name="javax.servlet.api" export="true"/>

                                  <module name="javax.servlet.jsp.api" export="true"/>

                                  <module name="javax.servlet.jstl.api" export="true"/>

                                  <module name="javax.validation.api" export="true"/>

                                  <module name="com.sun.jsf-impl" export="true"/>

                        </dependencies>

     

     

                        <resources>

                                  <resource-root path="jsf-api-2.2.1.jar"/>

                        </resources>

              </module>

     

     

    4.          jsf-impl:

              a.          Backup existing files in <jboss_home>/modules/com/sun/jsf-impl/main directory into some other directory (e.g, old-main)

              b.          Copy jsf-api-2.2.1.jar into <jboss_home>/modules/com/sun/jsf-impl/main directory

              c.          Create module.xml file inside <jboss_home>/modules/com/sun/jsf-impl/main directory with the following contents:

     

     

              <?xml version="1.0" encoding="UTF-8"?>

              <module xmlns="urn:jboss:module:1.1" name="com.sun.jsf-impl" slot="main">

                        <properties>

                                  <property name="jboss.api" value="private"/>

                        </properties>

     

     

                        <dependencies>

                                  <module name="javax.faces.api" slot="main"/>

                                  <module name="javaee.api"/>

                                  <module name="javax.servlet.jstl.api"/>

                        </dependencies>

     

     

                        <resources>

                                  <resource-root path="jsf-impl-2.2.1.jar"/>

                        </resources>

              </module>

     

     

    5.          faces-config:

              Replace starting tag of faces-config file with the following one:

     

     

              <faces-config xmlns="http://java.sun.com/xml/ns/javaee"

                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_2.xsd"

                        version="2.2">

     

     

    6. You can find recent jsf-2.2.x jars from https://maven.java.net/index.html#view-repositories;public~browsestorage

     

    Thanks to all you for your help.

  • 10. Re: JBoss 7.1 - Migration to JSF 2.2
    jol testor Newbie

    Hi all,

     

    I followed every step and tried everything to migrate to JSF2.2 for my jBoss 7.1.1.

    I want to use CDI for JSF, so I have an empty beans.xml.

    During deployment of my simple (nearly empty) JEE project I get the following error:

     

    18:09:07,596 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Critical error during deployment: : org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.flow.builder.FlowDefinition

              at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:586) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.loadFlows(ApplicationAssociate.java:323) [jsf-impl-2.2.1.jar:2.2.1-SNAPSHOT]

    ........

     

    So as you can see I am using the latest jsf 2.2.1 snapshot and jboss wants to use them for my testapplication :

    Other versions like jsf 2.2.0-m14 did not work either.

     

    What am I missing? I am looking forward to your replies.

     

    Thank you

    Oliver

  • 11. Re: JBoss 7.1 - Migration to JSF 2.2
    Stan Silvert Master

    jol testor wrote:

     


    18:09:07,596 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Critical error during deployment: : org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.flow.builder.FlowDefinition

              at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:586) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.loadFlows(ApplicationAssociate.java:323) [jsf-impl-2.2.1.jar:2.2.1-SNAPSHOT]

    ........

     

    So as you can see I am using the latest jsf 2.2.1 snapshot and jboss wants to use them for my testapplication :

    Other versions like jsf 2.2.0-m14 did not work either.

     

    What am I missing? I am looking forward to your replies.

     

    Thank you

    Oliver

    Newer versions of Mojarra 2.2 include CDI Extensions for handling Flows.  The code that loads those extensions is included in the latest nightly build of AS8/WildFly.  You might have trouble getting this to work in AS 7.1.1.  I'll try to look into it eventually.

     

    Stan

  • 12. Re: JBoss 7.1 - Migration to JSF 2.2
    jol testor Newbie

    Hi Stan,

     

    thanks for the answer. The new FlowScope is our main motivation for using 2.2. It is essential for the project and we want to get rid of Spring Webflow. If I get you right,

    the chances to get JSF 2.2 final running on Jboss 7.1.1 are not good (probably never)? How about EAP 6.1.0? Do you think JSF 2.2 will officially be supported on 6.1.0?

    It would also help us to know, if JSF 2.2 won't be supported below AS8/Wildfly officially.

     

    Thank you very much

    Oliver

  • 13. Re: JBoss 7.1 - Migration to JSF 2.2
    Stan Silvert Master

    jol testor wrote:

     

    If I get you right, the chances to get JSF 2.2 final running on Jboss 7.1.1 are not good (probably never)?

    You'll probably never get all JSF 2.2 features completely working on 7.1.1.  You would essentially need to backport the JSF subsystem from AS8/WildFly.

     

     

    How about EAP 6.1.0? Do you think JSF 2.2 will officially be supported on 6.1.0?

    It would also help us to know, if JSF 2.2 won't be supported below AS8/Wildfly officially.

    Official support for JSF 2.2 (and all other new JEE7 components) starts with EAP 6.2, which is based on AS8/WildFly.

     

    Stan

  • 14. Re: JBoss 7.1 - Migration to JSF 2.2
    Julien Boz Newbie

    So is there a solution to use jsf 2.2.4 with jboss 7.1.2 ?

    I'm blocked with WELD-001303 No active contexts for scope type javax.faces.flow.builder.FlowDefinition

     

    Thanks in advance.

1 2 Previous Next