5 Replies Latest reply: Jul 4, 2011 11:09 PM by 827987 RSS

    Problem with Richfaces, JSF 1.2, Facelets application

    827987
      Hello

      I have trouble using Weblogic 10.3.3 with my JSF-application which is constructed using Richfaces 3.3.3 and Facelets. First I had problems with deployment but with adding weblogic.xml to project.

      This is the weblogic.xml content :

      <?xml version = '1.0' encoding = 'windows-1252'?>
      <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"
      xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
      <library-ref>
      <library-name>jsf</library-name>
      <specification-version>1.2</specification-version>
      <implementation-version>1.2</implementation-version>
      <exact-match>false</exact-match>
      </library-ref>
      <container-descriptor>
      <prefer-web-inf-classes>true</prefer-web-inf-classes>
      </container-descriptor>
      </weblogic-web-app>

      This application works without problems in Glassfish 2.1 but when I try to access my application in Weblogic, I get following exception :

      Error 500--Internal Server Error

      javax.el.ELException: /Main.xhtml: The class 'katva.soa.logging.web.soaloggerweb.SessionController' does not have the property 'navigateToMonitor'.
           at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:53)
           at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
           at com.sun.facelets.compiler.UILeaf.encodeAll(UILeaf.java:149)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
           at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
           at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
           at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
           at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

      SessionController - managed bean has method mentioned above, here is the part of the page where the SessionController - bean is referenced:
      <a4j:form id="linkForm">

      <li><h:commandLink value="#{msgs.Main_logSearchLink}" action="#{SessionController.navigateToMonitor}"/></li>
      <li><h:commandLink value="#{msgs.Main_maintenanceLink}" action="#{SessionController.navigateMaintenance}"/></li>
      </a4j:form>

      Could someone help with this ? I am getting desperate and I would need to solve this quite quickly...

      Thank you for everyone who can help with this

      Best Regards Tuomas Katva
        • 1. Re: Problem with Richfaces, JSF 1.2, Facelets application
          827987
          I managed to solve this, Weblogic didn't like the capital letters in the managed beans. Name in the faces-config had to be defined with capital letters but in the page you had to use lowercase letters. But another problem occurred, when the page was displayed no tags was rendered! I am using facelets, richfaces 3.3.3 in this application and only error message I got was weblogic could not open the zip-file, probaply meaning that it could not open the facelets-jar in the Web-Inf... I now remembered that I had this problem earlier and I wasn't able to solve this... Please help...

          If would like try and deploy the web-application in a " exploded form" how can I do that? And would it help if moved the jar from war to <domain_home>/lib ?

          Than you

          Best regards Tuomas
          • 2. Re: Problem with Richfaces, JSF 1.2, Facelets application
            René van Wijk
            You can provide a WAR structure like this:
            WAR
                WEB-INF
                     faces-config.xml
                     web.xml
                     classes (containing your packages and classes)
                     lib
                        commons-beanutils-1.7.0.jar
                        commons-collections-3.2.jar
                        commons-digester-1.8.jar
                        commons-logging-1.0.4.jar
                        jhighlight-1.0.jar
                        jsf-api.jar
                        jsf-facelets.jar
                        jsf-impl.jar
                        jstl-api-1.2.jar
                        jstl-impl-1.2.jar
                        richfaces-api-3.3.1.GA.jar
                        richfaces-impl-3.3.1.GA.jar
                        richfaces-ui-3.3.1.GA.jar
                otherpage.xhtml
                yourpage
                    somepage.xhtml    
            You do need to move jars to the domain-home/lib directory, which is also bad practice.
            More information on application packaging and classloading can be found here: http://middlewaremagic.com/weblogic/?p=6725
            • 3. Re: Problem with Richfaces, JSF 1.2, Facelets application
              827987
              Hi

              Thank you for your reply... Where should I put this exploded folder-hierarchy so that application can be deployed. Most perfect would be if someone could tell me about this jar-processing error (error opening zip-file) here's the stack trace :

              <Error> <facelets.compiler> <BEA-000000> <Compiler Initialization Error
              java.util.zip.ZipException: error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java:137)
              at java.util.jar.JarFile.<init>(JarFile.java:149)
              at java.util.jar.JarFile.<init>(JarFile.java:86)

              This jar is in the war's structure and the war should have all rights correct.

              This war works just fine with Glassfish.

              Thank you

              Best Regards Tuomas
              • 4. Re: Problem with Richfaces, JSF 1.2, Facelets application
                René van Wijk
                This is probably related: Facelets not rendered on Weblogic 10.3.3

                A step by step example

                - create a web.xml file, with the following contents:
                <?xml version="1.0" encoding="UTF-8"?>
                <web-app 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-app_2_5.xsd"
                         version="2.5">
                    <context-param>
                        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                        <param-value>.xhtml</param-value>
                    </context-param>
                    <context-param>
                        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                        <param-value>server</param-value>
                    </context-param>
                    <context-param>
                        <param-name>org.richfaces.SKIN</param-name>
                        <param-value>blueSky</param-value>
                    </context-param>
                    <context-param>
                        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                        <param-value>enable</param-value>
                    </context-param>
                    <filter>
                        <filter-name>RichFaces Filter</filter-name>
                        <filter-class>org.ajax4jsf.Filter</filter-class>
                    </filter>
                    <filter-mapping>
                        <filter-name>RichFaces Filter</filter-name>
                        <servlet-name>Faces Servlet</servlet-name>
                        <dispatcher>REQUEST</dispatcher>
                        <dispatcher>FORWARD</dispatcher>
                        <dispatcher>INCLUDE</dispatcher>
                    </filter-mapping>
                    <servlet>
                        <servlet-name>Faces Servlet</servlet-name>
                        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                        <load-on-startup>1</load-on-startup>
                    </servlet>
                    <servlet-mapping>
                        <servlet-name>Faces Servlet</servlet-name>
                        <url-pattern>/faces/*</url-pattern>
                    </servlet-mapping>
                    <listener>
                        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                    </listener>
                </web-app>
                - create a faces-config.xml file with at least the following contents:
                <?xml version='1.0' encoding='UTF-8'?>
                <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_1_2.xsd"
                              version="1.2">
                    <application>
                        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                    </application>
                </faces-config>
                - create an example page
                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE html
                        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
                      xmlns:h="http://java.sun.com/jsf/html"
                      xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:a4j="http://richfaces.org/a4j"
                      xmlns:rich="http://richfaces.org/rich">
                <head>
                    <title></title>
                </head>
                <body>
                <a4j:form id="form">
                    <rich:panel header="Login" style="width: 750px">
                        <h:panelGrid columns="3">
                            <h:outputText id="label" value="Password"/>
                            <h:inputText id="login" value="Type Your Password"/>
                            <rich:message for="login"/>
                            <f:facet name="footer">
                                <rich:toolBar height="20" itemSeparator="line">
                                    <rich:toolBarGroup location="right">
                                        <h:commandButton value="Click To Login"/>
                                    </rich:toolBarGroup>
                                </rich:toolBar>
                            </f:facet>
                        </h:panelGrid>
                    </rich:panel>
                </a4j:form>
                </body>
                </html>
                - package this into the following structure:
                WAR
                    WEB-INF
                         faces-config.xml
                         web.xml
                         lib
                            commons-beanutils-1.7.0.jar
                            commons-collections-3.2.jar
                            commons-digester-1.8.jar
                            commons-logging-1.0.4.jar
                            jhighlight-1.0.jar
                            jsf-api.jar
                            jsf-facelets.jar
                            jsf-impl.jar
                            jstl-api-1.2.jar
                            jstl-impl-1.2.jar
                            richfaces-api-3.3.1.GA.jar
                            richfaces-impl-3.3.1.GA.jar
                            richfaces-ui-3.3.1.GA.jar
                    test.xhtml
                And deploy it to WebLogic. Upon deployment the following logging is observed:
                Jul 4, 2011 2:09:44 PM com.sun.faces.config.ConfigureListener contextInitialized
                INFO: Initializing Mojarra (1.2_14-b01-FCS) for context '/JSFFaceletsRichFaces'
                Jul 4, 2011 2:09:45 PM com.sun.faces.spi.InjectionProviderFactory getProviderInstance
                SEVERE: JSF1030: The specified InjectionProvider implementation 'com.bea.faces.WeblogicInjectionProvider' cannot be loaded.
                Jul 4, 2011 2:09:45 PM com.sun.faces.spi.InjectionProviderFactory createInstance
                INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
                Jul 4, 2011 2:09:45 PM org.ajax4jsf.cache.CacheManager getCacheFactory
                INFO: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
                Jul 4, 2011 2:09:45 PM org.ajax4jsf.cache.LRUMapCacheFactory createCache
                INFO: Creating LRUMap cache instance using parameters: {org.richfaces.CONTROL_SKINNING=enable, javax.faces.STATE_SAVING_METHOD=server, javax.faces.DEFAULT_SUFFIX=.xhtml, com.sun.faces.injectionProvider=com.bea.faces.WeblogicInjectionProvider, org.richfaces.SKIN=blueSky}
                Jul 4, 2011 2:09:45 PM org.ajax4jsf.cache.LRUMapCacheFactory createCache
                INFO: Creating LRUMap cache instance of default capacity
                Jul 4, 2011 2:09:45 PM org.ajax4jsf.cache.CacheManager getCacheFactory
                INFO: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
                Jul 4, 2011 2:09:45 PM org.ajax4jsf.cache.LRUMapCacheFactory createCache
                INFO: Creating LRUMap cache instance using parameters: {org.richfaces.CONTROL_SKINNING=enable, javax.faces.STATE_SAVING_METHOD=server, javax.faces.DEFAULT_SUFFIX=.xhtml, com.sun.faces.injectionProvider=com.bea.faces.WeblogicInjectionProvider, org.richfaces.SKIN=blueSky}
                Jul 4, 2011 2:09:45 PM org.ajax4jsf.cache.LRUMapCacheFactory createCache
                INFO: Creating LRUMap cache instance of default capacity
                Enter the URL to access the application, for example, http://localhost:7001/JSFFaceletsRichFaces/faces/test.xhtml

                et voila RichFaces and Facelets on WebLogic
                • 5. Re: Problem with Richfaces, JSF 1.2, Facelets application
                  827987
                  Thank you... After fiddling with jars and not using the jsf-libraries which come with the Weblogic. I was able to get my application working!