2 Replies Latest reply on Jun 10, 2008 4:59 AM by jorellan

    Richfaces 3.2.1.GA + Tomcat 6

    jorellan

      I've been working till now with RichFaces 3.1.5.GA and Tomcat 6 without any problem. I tried upgrading to 3.2.1.GA just replacing the three jar files, since the configuration seems to be the same, but Tomcat does not start correctly.

      When I restart the server, console shows a problem in faces-config.xml, which is not shown when I use RichFaces 3.1.x

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

      GRAVE: Parse Error at line 5 column 17: Document root element "faces-config", must match DOCTYPE root "null".
      org.xml.sax.SAXParseException: Document root element "faces-config", must match DOCTYPE root "null".
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)

      ...

      GRAVE: Parse Error at line 5 column 17: Document is invalid: no grammar found.
      org.xml.sax.SAXParseException: Document is invalid: no grammar found.
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)

      ....
      and finally a NoClassDefFoundError exception :

      GRAVE: Excepción enviando evento inicializado de contexto a instancia de escuchador de clase com.sun.faces.config.ConfigureListener
      java.lang.NoClassDefFoundError: javax/faces/component/ActionSource2
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

      -----------

      I've thought maybe there is any conflict or incompatibility with other jar files I have in my project:

      common-annotations.jar
      commons-beanutils-1.7.0.jar
      commons-collections-3.2.1.jar
      commons-digester-1.8.jar
      commons-javaflow-20060411.jar
      commons-lang.jar
      commons-logging-1.1.1.jar
      el-ri.jar
      itext-1.3.1.jar
      jasperreports-2.0.5.jar
      jsf-api.jar
      jsf-facelets.jar
      jsf-impl.jar
      jsf-tlds.jar
      jstl.jar
      ojdbc14.jar
      richfaces-api-3.2.1.GA.jar
      richfaces-impl-3.2.1.GA.jar
      richfaces-ui-3.2.1.GA.jar
      standard.jar
      struts-el.jar
      struts.jar

      -----

      I would appreciate any help!! I'm losing my head trying to solve this! :)

      Thanks!

        • 1. Re: Richfaces 3.2.1.GA + Tomcat 6

          RichFaces 3.2.x requires JSF 1.2. You still have a JSF RI 1.1

          • 2. Re: Richfaces 3.2.1.GA + Tomcat 6
            jorellan

            Fixed!!

            I was working with JSF 1.2 because there are some functionalities I'm applying that wouldn't work with JSF 1.1. But your comment made me think that probably I had a conflict with an old jar file.

            So, I downloaded the RichFaces 3.2.1 GA sample.

            http://repository.jboss.com/maven2/org/richfaces/samples/richfaces-demo/3.2.1.GA/richfaces-demo-3.2.1.GA-tomcat6.war

            and I decided to use the JAR files of the sample, so I would start from a library configuration I'm sure that works.
            However the faces-config.xml parser problems that only appeared with RichFaces 3.2.x were still there!

            I finally found the error. I'm working with Eclipse WebTools and the assistant creates the XML code automatically.
            When I specify the <from-action> tag, this assistant leaves a breakline producing an error. For any reason, with RichFaces 3.1.x, this error is not show (I have no idea what this happens)

            <from-action>
            #{visitasParcelaBean.crearVisita}</from-action>

            I just removed that breakline, and restarted the server and everything worked perfect.

            Thanks!!