0 Replies Latest reply on Jul 30, 2008 8:47 AM by Sumeet

    JSF + Portlet bridge on Jboss 4.2.2 GA deployment error

    Sumeet Newbie

      hi,
      when i deployed my JSF application with portlet bridge then i got this error:
      kindly help as soon as possible.

      Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener

      my web.xml is:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5" 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">
      <context-param>
      <param-name>com.sun.faces.verifyObjects</param-name>
      <param-value>false</param-value>
      </context-param>

      <filter-name>ResponseHeaders</filter-name>
      <filter-class>org.rancore.rsp.util.ResponseHeadersFilter</filter-class>

      <init-param>
      <param-name>my-param</param-name>
      <param-value>Hello, World</param-value>
      </init-param>


      Require that the user log in before accessing any page
      other than the entry pages
      <filter-name>ForcedLoginFilter</filter-name>
      <filter-class>org.rancore.rsp.util.ForcedLoginFilter</filter-class>
      <!--ACTION_PHASE
      RENDER_PHASE-->
      <init-param>
      <param-name>LoginURI</param-name>
      <param-value>/jsp/login.jsp</param-value>
      </init-param>
      <init-param>
      ViewIDs for which this filter must not
      forward back to the login page.
      <param-name>NoForwardViewIds</param-name>
      <param-value>login.jsp corporateInfoMain.jsp result.jsp newUpdatesMain.jsp forgotPassword.jsp registrationStep1.jsp registrationStep2.jsp</param-value>
      </init-param>


      <!--
      <filter-name>UploadFilter</filter-name>
      <filter-class>com.sun.webui.jsf.util.UploadFilter</filter-class>
      <init-param>
      The maximum allowed upload size in bytes. If this is set to a negative value, there is no maximum. The default value is 1000000.
      <param-name>maxSize</param-name>
      <param-value>1000000</param-value>
      </init-param>
      <init-param>
      The size (in bytes) of an uploaded file which, if it is exceeded, will cause the file to be written directly to disk instead of stored in memory. Files smaller than or equal to this size will be stored in memory. The default value is 4096.
      <param-name>sizeThreshold</param-name>
      <param-value>4096</param-value>
      </init-param>
      -->
      <filter-mapping>
      <filter-name>ResponseHeaders</filter-name>
      <url-pattern>*.jsp</url-pattern>
      REQUEST
      FORWARD
      </filter-mapping>
      <filter-mapping>
      <filter-name>ForcedLoginFilter</filter-name>
      <url-pattern>*.jsp</url-pattern>

      REQUEST
      INCLUDE
      FORWARD
      </filter-mapping>

      <context-param>
      <param-name>com.sun.faces.forceLoadConfiguration</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
      </context-param>

      <context-param>
      <param-name>javax.portlet.faces.renderPolicy</param-name>
      <param-value>ALWAYS_DELEGATE</param-value>
      </context-param>

      <context-param>
      <param-name>javax.portlet.faces.BridgeImplClass</param-name>
      <param-value>org.apache.myfaces.portlet.faces.bridge.BridgeImpl</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
      </context-param>

      <context-param>
      <param-name>javax.faces.application.CONFIG_FILES</param-name>
      <param-value>/WEB-INF/faces-config.xml</param-value>
      </context-param>

      <context-param>
      <param-name>com.sun.faces.validateXml</param-name>
      <param-value>true</param-value>
      </context-param>



      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>



      <!-- Faces Servlet Mapping -->

      <servlet-name>ExceptionHandlerServlet</servlet-name>
      <servlet-class>com.sun.errorhandler.ExceptionHandler</servlet-class>
      <init-param>
      <param-name>errorHost</param-name>
      <param-value>localhost</param-value>
      </init-param>
      <init-param>
      <param-name>errorPort</param-name>
      <param-value>24444</param-value>
      </init-param>


      <servlet-name>ThemeServlet</servlet-name>
      <servlet-class>com.sun.webui.theme.ThemeServlet</servlet-class>


      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>


      <error-page>
      <exception-type>javax.servlet.ServletException</exception-type>
      /error/ExceptionHandler
      </error-page>
      <error-page>
      <exception-type>java.io.IOException</exception-type>
      /error/ExceptionHandler
      </error-page>
      <error-page>
      <exception-type>javax.faces.FacesException</exception-type>
      /error/ExceptionHandler
      </error-page>
      <error-page>
      <exception-type>com.sun.rave.web.ui.appbase.ApplicationException</exception-type>
      /error/ExceptionHandler
      </error-page>
      <jsp-config>
      <jsp-property-group>
      <url-pattern>*.jspf</url-pattern>
      <is-xml>true</is-xml>
      </jsp-property-group>
      </jsp-config>
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>action</web-resource-name>
      Declarative Security Tests
      <url-pattern>*.jsp</url-pattern>
      <http-method>HEAD</http-method>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      <http-method>PUT</http-method>
      <http-method>DELETE</http-method>
      </web-resource-collection>
      <!--The ROle which can access these resources-->
      <auth-constraint>
      <role-name>Echo</role-name>
      </auth-constraint>
      <user-data-constraint>
      no description
      <transport-guarantee>NONE</transport-guarantee>
      </user-data-constraint>
      </security-constraint>


      <!--The login page in case of form based authentication-->
      <login-config>
      <auth-method>FORM</auth-method>
      <form-login-config>
      <form-login-page>/jsp/login.jsp</form-login-page>
      <form-error-page>/jsp/logoff.jsp</form-error-page>
      </form-login-config>
      </login-config>

      <security-role>
      A user allowed to invoke echo methods
      <role-name>Echo</role-name>
      </security-role>
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>ExceptionHandlerServlet</servlet-name>
      <url-pattern>/error/ExceptionHandler</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>ThemeServlet</servlet-name>
      <url-pattern>/theme/*</url-pattern>
      </servlet-mapping>

      <session-config>
      <session-timeout>3</session-timeout>
      </session-config>


      <taglib-uri>http://java.sun.com/portlet</taglib-uri>
      <taglib-location>/WEB-INF/tld/portlet.tld</taglib-location>


      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

      </web-app>

      my portlet.xml is:
      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
      http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0">
      <filter-mapping>
      <filter-name>ForcedLoginFilter</filter-name>
      <portlet-name>TestJSFPortlet1</portlet-name>
      </filter-mapping>

      <portlet-name>loginPortlet</portlet-name>
      <portlet-class>org.rancore.rsp.portlet.LoginJSFPortlet</portlet-class>
      <init-param>
      DEFAULT_VIEW
      /jsp/login.jsp
      </init-param>

      <mime-type>text/html</mime-type>
      <portlet-mode>view</portlet-mode>
      <portlet-mode>edit</portlet-mode>
      <portlet-mode>help</portlet-mode>

      <portlet-info>

      </portlet-info>


      <portlet-name>CorporateInfoPortlet</portlet-name>
      <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
      <init-param>
      javax.portlet.faces.defaultViewId.view
      /jsp/corporateInfoMain.jsp
      </init-param>
      <init-param>
      javax.portlet.faces.defaultViewId.edit
      /jsp/corporateInfoMain.jsp
      </init-param>
      <init-param>
      javax.portlet.faces.defaultViewId.help
      /jsp/corporateInfoMain.jsp
      </init-param>
      <init-param>
      <param-name>javax.portlet.faces.preserveActionParams</param-name>
      <param-value>true</param-value>
      </init-param>

      <mime-type>text/html</mime-type>
      <portlet-mode>view</portlet-mode>
      <!--<portlet-mode>edit</portlet-mode>
      <portlet-mode>help</portlet-mode>-->

      <portlet-info>

      </portlet-info>


      <portlet-name>NewUpdatesPortlet</portlet-name>
      <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
      <init-param>
      com.sun.faces.portlet.INIT_VIEW
      /jsp/newUpdatesMain.jsp
      </init-param>

      <mime-type>text/html</mime-type>
      <portlet-mode>view</portlet-mode>
      <!--<portlet-mode>edit</portlet-mode>
      <portlet-mode>help</portlet-mode>-->

      <portlet-info>

      </portlet-info>

      </portlet-app>

      my faces-config.xml
      <?xml version='1.0' encoding='UTF-8'?>

      <!-- =========== FULL CONFIGURATION FILE ================================== -->

      <faces-config version="1.2"
      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">


      <view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
      <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
      <locale-config>
      <default-locale>en</default-locale>
      <supported-locale>en</supported-locale>
      <supported-locale>fr_CA</supported-locale>
      <supported-locale>es</supported-locale>
      <supported-locale>hi-IN</supported-locale>
      </locale-config>
      <message-bundle>MessageResource</message-bundle>


      <managed-bean>
      Basic Login Bean
      <managed-bean-name>Login1</managed-bean-name>
      <managed-bean-class>org.rancore.rsp.bean.Login</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>

      <managed-bean>
      Registration Bean
      <managed-bean-name>Reg</managed-bean-name>
      <managed-bean-class>org.rancore.rsp.bean.Registration</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>

      <managed-bean>
      Common Validator Bean, it includes all the common validation functions
      <managed-bean-name>CommonValidator</managed-bean-name>
      <managed-bean-class>org.rancore.rsp.util.CommonValidators</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>

      <!-- Navigation rule for login.jsp file -->
      <navigation-rule>
      <from-view-id>/jsp/login.jsp</from-view-id>
      <navigation-case>
      <from-outcome>success</from-outcome>
      <to-view-id>/jsp/result.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
      <from-outcome>failure</from-outcome>
      <to-view-id>/jsp/login.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
      <from-outcome>registrationSuccess</from-outcome>
      <to-view-id>/jsp/registrationStep1.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
      <from-outcome>forgotPassword</from-outcome>
      <to-view-id>/jsp/forgotPassword.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>

      <!-- Navigation rule for registrationStep1.jsp file -->
      <navigation-rule>
      <from-view-id>/jsp/registrationStep1.jsp</from-view-id>
      <navigation-case>
      <from-outcome>step1Success</from-outcome>
      <to-view-id>/jsp/registrationStep2.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>


      </faces-config>