6 Replies Latest reply on Feb 25, 2010 1:43 PM by alcurios

    Problems running application with JSF 1.1 on JBoss 5

      Hi,

       

      we have a web application using JSF 1.1

      We are moving this application from Tomcat 5.5 to JBoss 5

      We deployed the application under JBoss but every time we call a jsp which makes use of JSF we get a compliation error.

      I think this is beacause the applicatoin is using the version of JSF shipped with JBoss, not the one in its lib dir under WEB-INF.

      How can I configure this application to use its own JSF jars ?

        • 1. Re: Problems running application with JSF 1.1 on JBoss 5
          ssilvert

          Hi,

           

          I'm interested in why you want to continue bundling JSF in your WAR?  The JSF 1.2 version in AS5 should be compatible with your JSF 1.1 application.

           

          If you are bundling MyFaces 1.1 then you can use an unsupported option JBoss5AndMyFaces

           

          Stan

          • 2. Re: Problems running application with JSF 1.1 on JBoss 5

            In fact I found the option you mention this morning and I am testing it.

            At the moment it seems to work fine.

            As regards the compatibility before appliying the

            org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL

            option I encountered this error while calling a jsp

             

            2010-02-18 12:46:10,430 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[...].[...].[jsp]] (ajp-127.0.0.1-8009-9) Servlet.service() for servlet jsp threw exception
            org.apache.jasper.JasperException: Unable to compile class for JSP:

             

            An error occurred at line: 4 in the jsp file: /page.jsp
            The method setLocale(String) in the type ViewTag is not applicable for the arguments (JspValueExpression)
            1: <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
            2: <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
            3: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
            4: <f:view locale="#{th_user.locale}">
            5:  <f:loadBundle basename="it.j2web.thunder.ui.web.Labels" var="labels" />
            6: <html>
            7: <head> 

             

            So it seemed to me that the code is non compatible with version 1.2

             

            We do not have the source files for this application so we are trying to get it working as is.

             

            Thanks a lot.

            • 3. Re: Problems running application with JSF 1.1 on JBoss 5
              ssilvert

              Looks like a problem in the application.  I don't see how it will work with JSF 1.1 either.  #{th_user.locale} needs to resolve to a Locale and not a String.

               

              Stan

              • 4. Re: Problems running application with JSF 1.1 on JBoss 5

                I' ve never used MyFaces and this application has been developed by a third party.

                Anyway I noticed that in jsf-impl.jar version 1.1 the method setLocale in com.sun.faces.taglib.jsf_core.ViewTag accepts a String in jsf-impl.jar contained in /opt/jboss/server/default/deploy/jbossweb.sar/jsf-libs/ which should be version 1.2 the same method accepts an object of class ValueExpression.

                This is what the compiler complains I think.

                • 5. Re: Problems running application with JSF 1.1 on JBoss 5
                  ssilvert

                  Ah.  I think I just figured out your problem.  I think you still have JSF 1.1 in your classpath.

                   

                  The tags changed from 1.1 to 1.2.  In 1.1, EL expressions were passed in as Strings and evaluated by JSF's EL.  In JSF 1.2 (and JSP 2.1), the EL is unified so that EL evaluation is done seperately.  The JSF and JSP markup doesn't change but it's handled differently.  So it looks like you are mixing the JSF 1.2 TLD that is built into JBoss with the JSF 1.1 implementation.

                   

                  Stan

                  • 6. Re: Problems running application with JSF 1.1 on JBoss 5

                    Probably this is what is appening.

                    Anyway I don't know how to solve this conflict and the option org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL is a good solution for us.

                     

                    I can tell you that the application is using these libraries:

                    commons-beanutils.jar
                    commons-collections.jar
                    commons-digester.jar
                    commons-fileupload.jar
                    commons-lang-2.1.jar
                    commons-lang.jar
                    commons-logging.jar
                    commons-validator.jar
                    jai_codec.jar
                    jai_core.jar
                    jakarta-oro.jar
                    jsf-api.jar
                    jsf-impl.jar
                    jstl.jar
                    log4j-1.2.9.jar
                    mlibwrapper_jai.jar
                    mysql-connector-java-3.1.11-bin.jar
                    otrix-shared.jar
                    otrix-webgrid.jar
                    otrix-webinput.jar
                    otrix-webmenu.jar
                    otrix-webstudio.jar
                    otrix-webtab.jar
                    otrix-webtree.jar
                    standard.jar
                    tomahawk.jar

                     

                    Bye and thanks