3 Replies Latest reply on Feb 14, 2011 7:54 AM by 447510

    Trouble getting icefaces, facelets and oc4j 10.1.2 to work together

      I'm building a web app using JDeveloper 10.1.3, but am deploying it to an OC4J 10.1.2 server. I'm using facelets and I'm trying to incorporate ICEfaces into it. Has anyone ever gotten these technologies to work together before?

      If I create an app with just facelets and JSF and deploy it to the 10.1.2 server, I can get it work (using both .xhtml and .jspx). If I deploy a regular jsf application using ICEfaces WITHOUT facelets to the same server, it works. But once I add ICEfaces AND facelets, things start to fall apart. My pages still display but the ICEfaces components don't seem to show up. All of the non-ICEfaces stuff on the page renders fine, but the ICEfaces components are just not there, with no error messages. I'm at a loss to explain it or to get it to work.

      I'm convinced it has to be something to do with the version of the server because when I run it locally in JDeveloper 10.1.3 everything seems to work and display properly. I've set my J2EE libraries locally to have the same libraries as the server, but when I run locally I'm still using a local OC4J instance of 10.1.3, so it must be doing something that 10.1.2 does not do.

      Any suggestions? Is this a lost cause? Should I just abandon facelets if I'm trying to use ICEfaces? Or am I just missing some setting somewhere that's going to make it all better? I've been going around in circles for days and can't seem to get any further than I am now.
        • 1. Re: Trouble getting icefaces, facelets and oc4j 10.1.2 to work together
          Just in case anyone is having this same problem... I think I've got it working now.

          I had to take the tag library definition files out of the icefaces-comps.jar's META-INF and manually put the in the WEB-INF for my project, as well as add the path to those taglib.xml files to my web.xml's "facelets.LIBRARIES" context parameter. It seems that OC4J 10.1.3 is able to do all of this on its own, but 10.1.2 needs a little help finding all of the facelets taglibs. I had to do the same thing to get just plain old facelets and jsf to run on the server as well, I was just missing the extra tag libraries for the icefaces components.

          Hopefully that was the whole issue... a simple facelets/icefaces app now seems to work.
          • 2. Re: Trouble getting icefaces, facelets and oc4j 10.1.2 to work together
            If you get an Illegal State Exception, like...
            java.lang.IllegalStateException: getOutputStream() has already been called for this response

            the problem is related with the getOutputStream handling of the underlying Facelet/JSF libraries. You can solve it, using MyFaces 1.1 with the Tomahawk components libraries.

            *0) Configure the icefaces FacesServlet.* Don't use the default MyFaces FacesServlet.

            *1) Include the myfaces and tomahawk components in the web application*

            and the icefaces libraries (1.8.2 can be used)
            FastInfoset.jar (if you wanna compress DOM)

            *2) Configure the Facelets handler.* If you don't configure it, the facelets and templates dont will be processed

            in the web application WEB-INF/faces-config.xml

            <faces-config >
            </faces-config >

            *3) Configure the OC4J classloader* to use the libraries inside the web application, and not the libraries provided by the server.

            in the enterprise application META-INF/orion-application.xml

                 schema-major-version="10" schema-minor-version="0" >
            <!-- you can include the default datasource... default-data-source="jdbc/OracleDS" -->

            <!-- to use the xerces XML parser -->
            <remove-inherited name="oracle.xml"/>
            <remove-inherited name="oracle.xml.security"/>

            in the web application WEB-INF/orion-web.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <orion-web-app directory-browsing="allow">
            <web-app-class-loader search-local-classes-first="true"
            include-war-manifest-class-path="true" />

            *3) configure the MyFaces Tomahawk Filter to solve the error.* If you are not using the tomahawk components, you need also include the configuration. This Filter solve the problem

            in the web application WEB-INF/web.xml

            <!-- MyFaces filters, required for tomahawk / facelets -->

            *4) Configure the facelets tag libraries.* In my case, i didn't need to include the TLDs in the web.xml. However, may be is needed in several OC4J versions

            open the icefaces-facelets.jar and extract the xml files from the META-INF directory. Put the files inside WEB-INF/tld directory

            in the web application WEB-INF/web.xml


            If you are creating facelets components, you may also need include the xml definitions filenames to the list.

            *5) Don't include DOCTYPE tags in the xhtml/jspx pages.* If you include the DOCTYPE tag, you will get an XML parser error. The IceFaces can process the XHTML tags and include the proper DOCTYPE to the browser.

            If you wanna control the DOCTYPE tag output, you can use an icefaces component

            <ice:outputDeclaration doctypeRoot="HTML"
            doctypePublic="-//W3C//DTD XHTML 1.0 Transitional//EN"
            doctypeSystem="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
            • 3. Re: Trouble getting icefaces, facelets and oc4j 10.1.2 to work together

              Could you confirm Icefaces 1.8.2 is compatible with JDeveloepr and Oracle Apps Server Release 2 (10.1.3) ?