From bridges-dev-perezjason@example.org Wed Aug 11 07:27:55 2010
Return-Path: <bridges-dev-perezjason@example.org>
Delivered-To: perezjason@example.org
Received: (qmail 3665 invoked from network); 11 Aug 2010 07:27:55 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 11 Aug 2010 07:27:55 -0000
Received: (qmail 92749 invoked by uid 500); 11 Aug 2010 07:27:55 -0000
Delivered-To: perezjason@example.org
Received: (qmail 92658 invoked by uid 500); 11 Aug 2010 07:27:53 -0000
Mailing-List: contact perezjason@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:perezjason@example.org>
List-Unsubscribe: <mailto:perezjason@example.org>
List-Post: <mailto:perezjason@example.org>
List-Id: <bridges-dev.portals.apache.org>
Reply-To: perezjason@example.org
Delivered-To: mailing list perezjason@example.org
Received: (qmail 92627 invoked by uid 99); 11 Aug 2010 07:27:51 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 07:27:51 +0000
X-ASF-Spam-Status: No, hits=0.7 required=10.0
	tests=SPF_NEUTRAL
X-Spam-Check-By: apache.org
Received-SPF: neutral (nike.apache.org: local policy)
Received: from [83.161.120.155] (HELO mail-ey0-f171.google.com) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 07:27:42 +0000
Received: by eyg7 with SMTP id 7so6368364eyg.2
        for <multiple recipients>; Wed, 11 Aug 2010 00:27:22 -0700 (PDT)
Received: by 83.161.120.155 with SMTP id e6mr12818062ebq.87.1281511642273;
        Wed, 11 Aug 2010 00:27:22 -0700 (PDT)
Received: from [83.161.120.155] ([83.161.120.155])
        by mx.google.com with ESMTPS id a48sm11224948eei.19.283.161.120.155.27.20
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Wed, 11 Aug 2010 00:27:21 -0700 (PDT)
Message-ID: <perezjason@example.org>
Date: Wed, 11 Aug 2010 09:27:19 +0200
From: Ate Douma <perezjason@example.org>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:83.161.120.155) Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6
MIME-Version: 1.0
To: Jetspeed Developers List <perezjason@example.org>, 
 Pluto Developers List <perezjason@example.org>,
 PortalApps Developers List <perezjason@example.org>, 
 Bridges Developers List <perezjason@example.org>
Subject: wd: Apache Retreat in Hursley, UK - 17-19th September
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Checked: Checked by ClamAV on apache.org



-------- Original Message --------
Subject: Apache Retreat in Hursley, UK - 17-19th September
Date: Thu, 5 Aug 2010 18:42:03 +0100 (BST)
From: Nick Burch <perezjason@example.org>
To: perezjason@example.org

Hi All

Just a reminder that our next Apache Retreat will be in Hursley in the UK,
from the 17th - 19th September. That's a little over a month away now!

As Apache Committers, we'd like to invite you to come for the whole
weekend. We've booked Tipis to stay in(!), and catering on-site. We've
conference facilities sorted for running a BarCamp both days, we'll be
doing lightning talks, socialising, hacking on code, learning about new
projects, drinking beer etc.

(We're also opening up the BarCamp on the Saturday daytime to everyone, so
feel free to invite any friends and colleagues along for the Saturday)

More details on the event, and a link to the signup site are available
from the ApacheCon wiki:
      http://wiki.apache.org/apachecon/

Also, if funding would be an issue to stop you attending, then the Travel
Assistance Committee are accepting applications for assistance to attend
until Wednesday 11th. More details, and a link to the applications site
are available from:
      http://www.apache.org/travel/

Nick
(On behalf of the retreat organisers)

---------------------------------------------------------------------
To unsubscribe, e-mail: perezjason@example.org
For additional commands, e-mail: perezjason@example.org


From bridges-dev-perezjason@example.org Mon Aug 30 17:28:20 2010
Return-Path: <bridges-dev-perezjason@example.org>
Delivered-To: perezjason@example.org
Received: (qmail 57990 invoked from network); 30 Aug 2010 17:28:20 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 30 Aug 2010 17:28:20 -0000
Received: (qmail 2409 invoked by uid 500); 30 Aug 2010 17:28:20 -0000
Delivered-To: perezjason@example.org
Received: (qmail 2352 invoked by uid 500); 30 Aug 2010 17:28:20 -0000
Mailing-List: contact perezjason@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:perezjason@example.org>
List-Unsubscribe: <mailto:perezjason@example.org>
List-Post: <mailto:perezjason@example.org>
List-Id: <bridges-dev.portals.apache.org>
Reply-To: perezjason@example.org
Delivered-To: mailing list perezjason@example.org
Received: (qmail 2343 invoked by uid 99); 30 Aug 2010 17:28:19 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Aug 2010 17:28:19 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO thor.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Aug 2010 17:28:17 +0000
Received: from thor (localhost [83.161.120.155])
	by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7UHRthc009945
	for <perezjason@example.org>; Mon, 30 Aug 2010 17:27:55 GMT
Message-ID: <4655973.71821283189275587.JavaMail.jira@thor>
Date: Mon, 30 Aug 2010 13:27:55 -0400 (EDT)
From: "Leonid Elkun (JIRA)" <perezjason@example.org>
To: perezjason@example.org
Subject: [jira] Created: (PB-108) JSF portlet bridge 1.0.0 implementation
 works incorrectly in a multi-user environment
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394
X-Virus-Checked: Checked by ClamAV on apache.org

JSF portlet bridge 1.0.0 implementation works incorrectly in a multi-user environment
-------------------------------------------------------------------------------------

                 Key: PB-108
                 URL: https://issues.apache.org/jira/browse/PB-108
             Project: Portals Bridges
          Issue Type: Bug
          Components: jsf
         Environment: MyFaces JSF 1.2 and Vignette Portal
            Reporter: Leonid Elkun


We have a Vignette / MyFaces 1.2 / portlet-bridge-1.0.0-beta based web application. When the development had started we've downloaded the latest version of the bridge at the time (roughly 08-2009) and still using this version.
After we started testing in a multi-user environment it had become clear that the bridge periodically corrupts incoming action (but not render) portal requests. The corresponding buggy code and fixes are described below.

1. Defective code
The following 2 methods wrongly assume that temporary registration of the bridge instance as a phase listerner while executing a render request doesn't affect concurrent action request (s) execution through the same instance. In reality a concurrent action request can sneak in between the lifecycle.addPhaseListener(this) and lifecycle.removePhaseListener(this) calls and end prematuraly just after the RESTORE_VIEW JSF phase (because of the context.renderResponse() call).

private void doFacesRender(
      RenderRequest request,
      RenderResponse response,
      FacesContext context,
      Lifecycle lifecycle,
      String scopeId,
      List <String> preExistingAttributes
      )
    throws BridgeException, BridgeUninitializedException, NullPointerException
  {
    ...
    if (context.getViewRoot() == null)
    {
      ...
      lifecycle.addPhaseListener(this);
      try
      {
        lifecycle.execute(context);
      }
      catch (Exception e)
      {
        ...
      }
      finally
      {
        lifecycle.removePhaseListener(this);
      }
    }
...
}

public void afterPhase(PhaseEvent event)
  {
    // only set renderresponse if in RESTORE_VIEW phase



    if (event.getPhaseId() == PhaseId.RESTORE_VIEW)
    {
      FacesContext context = event.getFacesContext();
      // Now restore the Faces Messages
      restoreFacesMessageState(context);
      context.renderResponse();
    }
  }

2. Fixed code
We've implemented and successfully tested the following fixes.

private void doFacesRender(
      RenderRequest request,
      RenderResponse response,
      FacesContext context,
      Lifecycle lifecycle,
      String scopeId,
      List <String> preExistingAttributes
      )
    throws BridgeException, BridgeUninitializedException, NullPointerException
  {
    ...
    if (context.getViewRoot() == null)
    {
      ...
      //lifecycle.addPhaseListener(this);
      try
      {
        lifecycle.execute(context);
      }
      catch (Exception e)
      {
        ...
      }
      finally
      {
        //lifecycle.removePhaseListener(this);
      }
...
}

private synchronized Lifecycle getLifecycle()
    throws BridgeException
  {
    try
    {
      if (mLifecycle == null)
      {
        LifecycleFactory lifecycleFactory = 
          (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
        String lifecycleId = 
          mPortletConfig.getPortletContext().getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR);
        if (lifecycleId == null)
        {
          lifecycleId = LifecycleFactory.DEFAULT_LIFECYCLE;
        }

        mLifecycle = lifecycleFactory.getLifecycle(lifecycleId);
        mLifecycle.addPhaseListener(this);
      }
      return mLifecycle;
    }
    catch (FacesException e)
    {
      Throwable rootCause = e.getCause();
      throw new BridgeException(e.getMessage(), rootCause);
    }
  }

public void afterPhase(PhaseEvent event)
  {
    if (BridgeUtil.getPortletRequestPhase().toString().contains("ACTION_PHASE"))
    {
    	return;
    }
    if (event.getPhaseId() == PhaseId.RESTORE_VIEW)
    {
      FacesContext context = event.getFacesContext();
      // Now restore the Faces Messages
      restoreFacesMessageState(context);
      context.renderResponse();
    }
  }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: perezjason@example.org
For additional commands, e-mail: perezjason@example.org



{'source': 'Apache Software Foundation Public Mail Archives'}