8 Replies Latest reply on Sep 3, 2009 8:31 PM by lpiccoli

    WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NPE

    titou09

      I'm currently testing JPBP 2.0 + Seam 2.2.1-SNAPSHOT + WebSphere Portal v6.1.0.2 en WebSphere v7.0.0.5 + facelets

      When the page containing my very simple portle (1 form, inputText, 1 commandButton) with one Seam component I receive the folllwoing exception:

      00000063 ApplicationMg A WSVR0221I: Application started: PA_Ports_Denis_Seam
      00000063 CompositionUn A WSVR0191I: Composition unit WebSphere:cuname=PA_Ports_Denis_Seam in BLA WebSphere:blaname=PA_Ports_Denis_Seam started.
      00000025 servlet I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [PA_Ports_Denis_Seam] [/wps/PA_Ports_Denis_Seam] [Portlet Denis 3] : L'initialisation a abouti.
      00000025 faces I Bridge class name is org.jboss.portletbridge.AjaxPortletBridge
      00000025 faces I The bridge does not support doHeaders method
      00000025 faces I Process headers request for portlet Portlet Denis 3
      00000025 faces I Process view request for portlet Portlet Denis 3
      00000025 SeamPhaseList E org.jboss.seam.jsf.SeamPhaseListenerWrapper beforePhase swallowing exception
       java.lang.NullPointerException
       at org.jboss.seam.navigation.Pages.getRequestUrl(Pages.java:543)
       at org.jboss.seam.navigation.Pages.getRequestScheme(Pages.java:478)
       at org.jboss.seam.contexts.FacesLifecycle.beginRequest(FacesLifecycle.java:57)
       at org.jboss.seam.jsf.SeamPhaseListener.beforeRestoreView(SeamPhaseListener.java:381)
       at org.jboss.seam.jsf.SeamPhaseListenerWrapper.beforePortletPhase(SeamPhaseListenerWrapper.java:184)
       at org.jboss.seam.jsf.SeamPhaseListenerWrapper.beforePhase(SeamPhaseListenerWrapper.java:164)
       at org.jboss.portletbridge.lifecycle.LifecyclePhase.execute(LifecyclePhase.java:65)
       at org.jboss.portletbridge.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:62)
       at org.jboss.portletbridge.lifecycle.PortletLifecycle.execute(PortletLifecycle.java:114)
       at org.jboss.portletbridge.AjaxPortletBridge.execute(AjaxPortletBridge.java:948)
       at org.jboss.portletbridge.AjaxPortletBridge.renderResponse(AjaxPortletBridge.java:761)
       at org.jboss.portletbridge.AjaxPortletBridge.doFacesRequest(AjaxPortletBridge.java:508)
       at javax.portlet.faces.GenericFacesPortlet.doFacesDispatch(GenericFacesPortlet.java:583)
       at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:474)
       at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
       at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:445)
       at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
       at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:128)
       at com.ibm.wps.propertybroker.standard.filter.C2APortletFilter.doFilter(C2APortletFilter.java:183)
      

      The code fails in seam on this line (Pages.java:543):
      return ( (HttpServletRequest) request).getRequestURL().toString();

      Any clue?

        • 1. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
          wesleyhales

          What does your web.xml look like?
          Do you have this in it:

          <context-param>
          
           <param-name>javax.faces.LIFECYCLE_ID</param-name>
          
           <param-value>SEAM_PORTLET</param-value>
          
           </context-param>

          http://www.jboss.org/files/portletbridge/docs/2.0.0.ALPHA/en/html_single/index.html#d0e371

          • 2. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
            titou09

            It's already there. Here is my web.xml :

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
            
             <display-name>Portlets Denis Seam</display-name>
            
             <context-param>
             <param-name>org.jboss.portletbridge.ExceptionHandler</param-name>
             <param-value>org.jboss.portletbridge.SeamExceptionHandlerImpl</param-value>
             </context-param>
             <context-param>
             <param-name>javax.faces.LIFECYCLE_ID</param-name>
             <param-value>SEAM_PORTLET</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>facelets.DEVELOPMENT</param-name>
             <param-value id="facelets.development.value">true</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.SKIP_COMMENTS</param-name>
             <param-value>false</param-value>
             </context-param>
            
             <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>
            
             <!-- Listeners -->
             <listener>
             <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
             </listener>
            
             <!-- Filters -->
             <filter>
             <filter-name>Seam Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Filter</filter-name>
             <url-pattern>/*</url-pattern>
             </filter-mapping>
            
             <!-- Servlets -->
             <servlet>
             <servlet-name>Seam Resource Servlet</servlet-name>
             <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>2</load-on-startup>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>Seam Resource Servlet</servlet-name>
             <url-pattern>/seam/resource/*</url-pattern>
             </servlet-mapping>
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.seam</url-pattern>
             </servlet-mapping>
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>/faces/*</url-pattern>
             </servlet-mapping>
            
             <!-- Autre -->
            
             <welcome-file-list>
             <welcome-file>index.html</welcome-file>
             </welcome-file-list>
            
            <!--
             <ejb-local-ref>
             <ejb-ref-name>EjbSynchronizations</ejb-ref-name>
             <ejb-ref-type>Session</ejb-ref-type>
             <local-home></local-home>
             <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
             </ejb-local-ref>
             -->
            </web-app>


            • 3. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
              titou09

              In fact, in the Pages.getRequestUrl() method, the facesContext.getExternalContext().getRequest() is not null, but facesContext.getExternalContext().getRequest().getRequestURl IS null...

              a request.toString() displays the following:

              com.ibm.ws.portletcontainer.core.impl.RenderRequestImpl@1a7b1a7b wrapping com.ibm.wps.engine.PortalRequestWrapper@34413441 wrapping com.ibm.wps.engine.ExtendedLocaleRequest@341d341d wrapping
              <?xml version="1.0" encoding="UTF-8"?>
              <com.ibm.wps.resolver.friendly.servlet.FriendlySelectionHttpServletRequestWrapper class="com.ibm.wps.resolver.friendly.servlet.FriendlySelectionHttpServletRequestWrapper">
               <contextPath>/wps</contextPath>
               <servletPath>/myportal</servletPath>
               <pathInfo>/!ut/p/c5/04_SB8K8xLLM9MSSzPy8xBz9CP0os3gXM5-QMGcLEwN3izALA0__YHeXMEdLYwMDA6B8pFm8s7ujh4m5D5Bv6GhuYORnGuwS6hlk6G5sBtKNS9bJhIBuEwK6w0GuNYs3wAEcDSDy-FyHV94Ev7ypsb6fR35uqn5BbmiEQaanLgC4ed8v/dl3/d3/L2dBISEvZ0FBIS9nQSEh/</pathInfo>
               <requestURI>/wps/myportal/!ut/p/c5/04_SB8K8xLLM9MSSzPy8xBz9CP0os3gXM5-QMGcLEwN3izALA0__YHeXMEdLYwMDA6B8pFm8s7ujh4m5D5Bv6GhuYORnGuwS6hlk6G5sBtKNS9bJhIBuEwK6w0GuNYs3wAEcDSDy-FyHV94Ev7ypsb6fR35uqn5BbmiEQaanLgC4ed8v/dl3/d3/L2dBISEvZ0FBIS9nQSEh/</requestURI>
               <parent class="com.ibm.ws.webcontainer.srt.SRTServletRequest">com.ibm.ws.webcontainer.srt.SRTServletRequest@48094809</parent>
               <friendlyPath>/denis</friendlyPath>
              </com.ibm.wps.resolver.friendly.servlet.FriendlySelectionHttpServletRequestWrapper>


              • 4. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
                titou09

                In the JSR-286 specs, section PLT.19.3.3 it is stated that

                The following methods of the HttpServletRequest must return null: getRemoteAddr,getRemoteHost, getRealPath, getLocalAddress, getLocalName, and getRequestURL


                It seems normal that request.getRequestUrl() return null in .
                So is this a bug in seam? in the bridge?
                Is the bridge supposed to solve this and provides/mock/fake something valid for getRequestURL() ? or maybe the path/stack used is not correct?

                • 5. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
                  titou09
                  • 6. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
                    lpiccoli

                    dennis,

                    beside the error above are u having any other issue with running Seam 2.2.1-SNAPSHOT with PB 2.0 alpha?

                    i am getting all sort of errors unless i use the seam2.2CR1 jars, anything else just cause problems.

                    any help is appreciated

                    -lp

                    • 7. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
                      titou09

                      I have only a very simple app to test WAS v7.0.0.5 + WPS v6.1.0.2 +Seam 2.2.1-snapshot + PB 2.0.0 and it works fine
                      I patched the org.jboss.seam.navigation.Pages.getRequestUrl() to returrn null if request.getRequestURL() is null as I'm waiting for PBR-117 to be investigated and sorted out
                      what kind of problem do you have? what AS are you using?

                      • 8. Re: WPS v6.1.0.2  +Seam 2.2.1-SNAPSHOT + JPBP 2.0 alpha = NP
                        lpiccoli

                        hi dennis

                        i am using jboss 4.2.6 with jbossportal2.7.2.

                        when using seam 2.2.0GA i get the existing page returned when accessing a s:link, instead of the requested link page.

                        i gave up and went back to portletbridge.1.0.0CR but it only seems to work with Seam2.2.0CR1, when i use Seam2.2.0GA it throws 'No Active Context' errors when accessing s:link.

                        u got any thought on why seam 2.2.0GA doesnt work the same as seam2.2.0CR1?

                        -lp