6 Replies Latest reply: Sep 5, 2012 7:43 AM by Martin Kožený RSS

JSF 2 with RichFaces 3.3.3.Final on JBoss 6.1.0.

Martin Kožený Newbie

Hi to all,

 

I am using NetBeans in my work for developing spring application with JSF 2 and RichFaces 3.3.3.Final. At first I was using as application server JBoss 5.1.0.GA, where are JSF 2 not supported, so I've replaced JBoss's JSF libraries and slightly changed its web.xml. When I've deployed the application and make initial request, app worked fine, but in JBoss log I got following exception:

 

 

15:46:46,738 SEVERE Error Loading Library: vfs:/C:/jboss-6.1.0.Final/server/default/deploy/simple610App.war/WEB-INF/lib/jsf-impl.jar/com/sun/faces/metadata/taglib/jstl-fn.taglib.xml: java.io.IOException: Error parsing :

    at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410)

    at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:431)

    at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:87)

    at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104)

    at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218)

    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149)

    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:100)

 

 

 

after hours of discovering the problem, I've decided to use JBoss 6.1.0.Final, which uses JSF 2 by default, but for my surprise I got the same error as when deploy the application on 5.1.0. I've tried several things like creating application from the beginning and adding some changes iteratively but this does not help.

 

Does anybody has an idea, what to do?

Thanks, Martin.

  • 1. Re: JSF 2 with RichFaces 3.3.3.Final on JBoss 6.1.0.
    Benjamin Seyinbour Expert

    hi Martin,

     

    I haven't used Richfaces for a couple of years, but here is what I think about your problem:

     

    It would seem that you have jsf-impl.jar in your Simple5App.war file. But JBoss already contains a copy of  the jsf-impl.jar, so there is no need for another copy in your  *.war file. The solution is to remove the jsf-impl.jar in your Simple5App.war/WEB-INF/lib before deploying  your the *.war.

  • 2. Re: JSF 2 with RichFaces 3.3.3.Final on JBoss 6.1.0.
    Martin Kožený Newbie

    Hi ebross,

     

    thanks for your reply, but I have tried this and after that I got the same error from JBoss libraries:

     

    14:37:12,840 SEVERE [compiler] Error Loading Library: vfszip:/C:/Program Files/jboss-5.1.0.GA/server/default/deploy/feisPortal.war/WEB-INF/lib/jsf-impl.jar/com/sun/faces/metadata/taglib/ui.taglib.xml

    java.io.IOException: Error parsing [vfszip:/C:/Program Files/jboss-5.1.0.GA/server/default/deploy/feisPortal.war/WEB-INF/lib/jsf-impl.jar/com/sun/faces/metadata/taglib/ui.taglib.xml]:

    I don't really what to do, same error occurs when deploying on AS 6.1.0.Final, which use jsf 2 by default.

  • 3. Re: JSF 2 with RichFaces 3.3.3.Final on JBoss 6.1.0.
    Benjamin Seyinbour Expert

    Hi Mark,

     

    The error shows that your deployed feisPortal.war still contains a jsf-impl.jar in feisPortal.war/WEB-INF/lib. As I said earlier, you don't need it in the feisPortal.war. You error is probably due to duplicate copies of jsf-impl.jar.

  • 4. Re: JSF 2 with RichFaces 3.3.3.Final on JBoss 6.1.0.
    Martin Kožený Newbie

    I am sorry ebross,

     

     

    I posted bad stacktrace. The error I am getting after removing jsf libraries from my project is following:

    15:57:43,554 ERROR [[/feisPortal]] StandardWrapper.Throwable

    java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory

  • 5. Re: JSF 2 with RichFaces 3.3.3.Final on JBoss 6.1.0.
    Benjamin Seyinbour Expert

    Ha! You also need to remove "jsf-api.jar" from your /WEB-INF/lib.  FacesContextFactory is in this jar.

     

     

    Sorry I forgot to mention it. Well I did warn you earlier that my Richfaces/JSF  is a bit rusty :-)

     

     

    Alternative solution:

     

    If I remember correctly, in your 'web.xml' you could add the following:

     

    <context-param>

        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>

        <param-value>true</param-value>

    </context-param>

     

     

    If  param-value is 'true', then JBoss will use the jsf-impl.jar and jsf-api.jar you have in your /WEB-INF/lib, otherwise it will use it own copies (as in the first Solution). Unless you have a good reason to do this, I would suggest against it. Duplicate jar files will increase the size of your foo.war file.

  • 6. Re: JSF 2 with RichFaces 3.3.3.Final on JBoss 6.1.0.
    Martin Kožený Newbie

    Now I've found the solution. Problem was causing library jboss-el-2.0.0.GA.jar and its expression factory defined in deployment descriptor web.xml:

     

     

    <context-param>
            <param-name>com.sun.faces.expressionFactory</param-name>
            <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
    </context-param>
    

     

     

    But by using this library is possible to use JSF 2 expressions on JBoss 5.1.0.GA, which supports only jsf 1.2.