From adffaces-user-return-margaretmorrison@example.net Fri Dec 21 23:44:05 2007
Return-Path: <adffaces-user-return-margaretmorrison@example.net>
Delivered-To: margaretmorrison@example.net
Received: (qmail 91458 invoked from network); 21 Dec 2007 23:44:05 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 21 Dec 2007 23:44:05 -0000
Received: (qmail 96719 invoked by uid 500); 21 Dec 2007 23:43:54 -0000
Delivered-To: margaretmorrison@example.net
Received: (qmail 96705 invoked by uid 500); 21 Dec 2007 23:43:54 -0000
Mailing-List: contact margaretmorrison@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:margaretmorrison@example.net>
List-Unsubscribe: <mailto:margaretmorrison@example.net>
List-Post: <mailto:margaretmorrison@example.net>
List-Id: <adffaces-user.incubator.apache.org>
Reply-To: margaretmorrison@example.net
Delivered-To: mailing list margaretmorrison@example.net
Received: (qmail 96696 invoked by uid 99); 21 Dec 2007 23:43:54 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Dec 2007 15:43:54 -0800
X-ASF-Spam-Status: No, hits=-2.0 required=10.0
	tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (nike.apache.org: local policy)
Received: from [83.161.120.155] (HELO nspiron-2.llnl.gov) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Dec 2007 23:43:41 +0000
X-Attachments: ExceptionHandlingActionListener.java
X-IronPort-AV: E=McAfee;i="5100,188,5191"; a="5158224"
X-IronPort-AV: E=Sophos;i="4.24,196,1196668800"; 
   d="java'?scan'208,217";a="5158224"
Received: from carlson14-ltp.llnl.gov ([83.161.120.155])
  by nspiron-2.llnl.gov with ESMTP; 21 Dec 2007 15:43:32 -0800
Message-Id: <margaretmorrison@example.net>
X-Mailer: QUALCOMM Windows Eudora Version 83.161.120.155
Date: Fri, 21 Dec 2007 15:43:29 -0800
To: margaretmorrison@example.net
From: John Carlson <margaretmorrison@example.net>
Subject: action-listener defined in faces-config.xml
Mime-Version: 1.0
Content-Type: multipart/mixed;
	boundary="=====================_631773312==_"
X-Virus-Checked: Checked by ClamAV on apache.org

--=====================_631773312==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="ExceptionHandlingActionListener.java"

package gov.llnl.nif.dataviz.actionlistener.exceptionhandler;

import java.sql.SQLException;

import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;

import oracle.toplink.essentials.exceptions.DatabaseException;

import org.apache.log4j.Logger;
import org.apache.myfaces.application.ActionListenerImpl;

public class ExceptionHandlingActionListener extends ActionListenerImpl {
	 private static Logger log = Logger.getLogger(ExceptionHandlingActionListener.class);

	  public String oneLiner(String s) {
		  String [] lines = s.split("[\r\n]+");
		  StringBuilder sb = new StringBuilder();
		  for (String line : lines) {
			  sb.append(line);
		  }
		  return sb.toString();
	  }
	  public void processAction(ActionEvent event) throws AbortProcessingException {
	    FacesContext facesContext = FacesContext.getCurrentInstance();
	    try {

	      super.processAction(event);
	    } catch (Exception fe) {      
	      Throwable databaseException = ExceptionUtils.getException(fe, DatabaseException.class);
	      if (databaseException != null) {
	       FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Database Error",oneLiner(databaseException.getMessage()));
	       facesContext.addMessage(null, facesMessage);
	      } else {
	    	  databaseException = ExceptionUtils.getException(fe, SQLException.class);
	          if (databaseException != null) {
	        	  FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "SQL Database error", oneLiner(databaseException.getMessage()));
	        	  facesContext.addMessage(null, facesMessage);
	          } else {
	        	  throw new FacesException(fe);
	          }
	       }
	    }
	  }

}

--=====================_631773312==_--

From adffaces-user-return-margaretmorrison@example.net Wed Dec 26 17:20:40 2007
Return-Path: <adffaces-user-return-margaretmorrison@example.net>
Delivered-To: margaretmorrison@example.net
Received: (qmail 37212 invoked from network); 26 Dec 2007 17:20:40 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 26 Dec 2007 17:20:40 -0000
Received: (qmail 38518 invoked by uid 500); 26 Dec 2007 17:20:29 -0000
Delivered-To: margaretmorrison@example.net
Received: (qmail 38511 invoked by uid 500); 26 Dec 2007 17:20:28 -0000
Mailing-List: contact margaretmorrison@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:margaretmorrison@example.net>
List-Unsubscribe: <mailto:margaretmorrison@example.net>
List-Post: <mailto:margaretmorrison@example.net>
List-Id: <adffaces-user.incubator.apache.org>
Reply-To: margaretmorrison@example.net
Delivered-To: mailing list margaretmorrison@example.net
Received: (qmail 38502 invoked by uid 99); 26 Dec 2007 17:20:28 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 09:20:28 -0800
X-ASF-Spam-Status: No, hits=-2.0 required=10.0
	tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (nike.apache.org: local policy)
Received: from [83.161.120.155] (HELO smtp.llnl.gov) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 17:20:16 +0000
X-Attachments: ExceptionHandlingActionListener1.java
X-IronPort-AV: E=McAfee;i="5100,188,5193"; a="23153773"
X-IronPort-AV: E=Sophos;i="4.24,208,1196668800"; 
   d="java'?scan'208,217";a="23153773"
Received: from carlson14-ltp.llnl.gov ([83.161.120.155])
  by smtp.llnl.gov with ESMTP; 26 Dec 2007 09:20:06 -0800
Message-Id: <margaretmorrison@example.net>
X-Mailer: QUALCOMM Windows Eudora Version 83.161.120.155
Date: Wed, 26 Dec 2007 09:20:04 -0800
To: margaretmorrison@example.net
From: John Carlson <margaretmorrison@example.net>
Subject: Fwd: action-listener defined in faces-config.xml
Mime-Version: 1.0
Content-Type: multipart/mixed;
	boundary="=====================_1040756609==_"
X-Virus-Checked: Checked by ClamAV on apache.org

--=====================_1040756609==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="ExceptionHandlingActionListener1.java"

package gov.llnl.nif.dataviz.actionlistener.exceptionhandler;

import java.sql.SQLException;

import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;

import oracle.toplink.essentials.exceptions.DatabaseException;

import org.apache.log4j.Logger;
import org.apache.myfaces.application.ActionListenerImpl;

public class ExceptionHandlingActionListener extends ActionListenerImpl {
	 private static Logger log = Logger.getLogger(ExceptionHandlingActionListener.class);

	  public String oneLiner(String s) {
		  String [] lines = s.split("[\r\n]+");
		  StringBuilder sb = new StringBuilder();
		  for (String line : lines) {
			  sb.append(line);
		  }
		  return sb.toString();
	  }
	  public void processAction(ActionEvent event) throws AbortProcessingException {
	    FacesContext facesContext = FacesContext.getCurrentInstance();
	    try {

	      super.processAction(event);
	    } catch (Exception fe) {      
	      Throwable databaseException = ExceptionUtils.getException(fe, DatabaseException.class);
	      if (databaseException != null) {
	       FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Database Error",oneLiner(databaseException.getMessage()));
	       facesContext.addMessage(null, facesMessage);
	      } else {
	    	  databaseException = ExceptionUtils.getException(fe, SQLException.class);
	          if (databaseException != null) {
	        	  FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, "SQL Database error", oneLiner(databaseException.getMessage()));
	        	  facesContext.addMessage(null, facesMessage);
	          } else {
	        	  throw new FacesException(fe);
	          }
	       }
	    }
	  }

}

--=====================_1040756609==_--

From adffaces-user-return-margaretmorrison@example.net Wed Dec 26 17:27:09 2007
Return-Path: <adffaces-user-return-margaretmorrison@example.net>
Delivered-To: margaretmorrison@example.net
Received: (qmail 37863 invoked from network); 26 Dec 2007 17:27:09 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 26 Dec 2007 17:27:09 -0000
Received: (qmail 41014 invoked by uid 500); 26 Dec 2007 17:26:58 -0000
Delivered-To: margaretmorrison@example.net
Received: (qmail 41002 invoked by uid 500); 26 Dec 2007 17:26:58 -0000
Mailing-List: contact margaretmorrison@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:margaretmorrison@example.net>
List-Unsubscribe: <mailto:margaretmorrison@example.net>
List-Post: <mailto:margaretmorrison@example.net>
List-Id: <adffaces-user.incubator.apache.org>
Reply-To: margaretmorrison@example.net
Delivered-To: mailing list margaretmorrison@example.net
Received: (qmail 40993 invoked by uid 99); 26 Dec 2007 17:26:58 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 09:26:58 -0800
X-ASF-Spam-Status: No, hits=-4.0 required=10.0
	tests=RCVD_IN_DNSWL_MED,SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (athena.apache.org: local policy)
Received: from [83.161.120.155] (HELO smtp.llnl.gov) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 17:26:35 +0000
X-Attachments: None
X-IronPort-AV: E=McAfee;i="5100,188,5193"; a="23154477"
X-IronPort-AV: E=Sophos;i="4.24,208,1196668800"; 
   d="scan'208";a="23154477"
Received: from carlson14-ltp.llnl.gov ([83.161.120.155])
  by smtp.llnl.gov with ESMTP; 26 Dec 2007 09:26:38 -0800
Message-Id: <margaretmorrison@example.net>
X-Mailer: QUALCOMM Windows Eudora Version 83.161.120.155
Date: Wed, 26 Dec 2007 09:26:38 -0800
To: margaretmorrison@example.net
From: John Carlson <margaretmorrison@example.net>
Subject: Re: Fwd: action-listener defined in faces-config.xml
In-Reply-To: <margaretmorrison@example.net>
References: <margaretmorrison@example.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed
X-Virus-Checked: Checked by ClamAV on apache.org

I'm beginning to understand that attaching a file messes up my main message.
I'll try again in a second.

John

From adffaces-user-return-margaretmorrison@example.net Wed Dec 26 17:33:59 2007
Return-Path: <adffaces-user-return-margaretmorrison@example.net>
Delivered-To: margaretmorrison@example.net
Received: (qmail 38736 invoked from network); 26 Dec 2007 17:33:59 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 26 Dec 2007 17:33:59 -0000
Received: (qmail 44083 invoked by uid 500); 26 Dec 2007 17:33:47 -0000
Delivered-To: margaretmorrison@example.net
Received: (qmail 44067 invoked by uid 500); 26 Dec 2007 17:33:47 -0000
Mailing-List: contact margaretmorrison@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:margaretmorrison@example.net>
List-Unsubscribe: <mailto:margaretmorrison@example.net>
List-Post: <mailto:margaretmorrison@example.net>
List-Id: <adffaces-user.incubator.apache.org>
Reply-To: margaretmorrison@example.net
Delivered-To: mailing list margaretmorrison@example.net
Received: (qmail 44058 invoked by uid 99); 26 Dec 2007 17:33:47 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 09:33:47 -0800
X-ASF-Spam-Status: No, hits=-0.3 required=10.0
	tests=HTML_MESSAGE,MIME_HTML_ONLY,RCVD_IN_DNSWL_MED,SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (nike.apache.org: local policy)
Received: from [83.161.120.155] (HELO nspiron-1.llnl.gov) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 17:33:33 +0000
X-Attachments: None
X-IronPort-AV: E=McAfee;i="5100,188,5193"; a="5403569"
X-IronPort-AV: E=Sophos;i="4.24,208,1196668800"; 
   d="scan'208,217";a="5403569"
Received: from carlson14-ltp.llnl.gov ([83.161.120.155])
  by nspiron-1.llnl.gov with ESMTP; 26 Dec 2007 09:33:25 -0800
Message-Id: <margaretmorrison@example.net>
X-Mailer: QUALCOMM Windows Eudora Version 83.161.120.155
Date: Wed, 26 Dec 2007 09:33:22 -0800
To: margaretmorrison@example.net
From: John Carlson <margaretmorrison@example.net>
Subject: Fwd: Re: [java] AOP with JSF, spring
Mime-Version: 1.0
Content-Type: text/html; charset="us-ascii"
X-Virus-Checked: Checked by ClamAV on apache.org

<html>
<body>
<blockquote type=cite class=cite cite="">There are some action listeners
that aren't being intercepted by my action-listener wrapper.&nbsp; In
particular,<br>
I have a set of tabs that look like:<br>
'<br>
<font face="Courier New, Courier" color="#008080">&lt;</font>
<font face="Courier New, Courier" color="#3F7F7F">tr:navigationPane
</font><font face="Courier New, Courier" color="#7F007F">hint</font>
<font face="Courier New, Courier">=</font>
<font face="Courier New, Courier" color="#2A00FF">&quot;tabs&quot;</font>
<font face="Courier New, Courier" color="#008080">&gt;<br>
&lt;</font><font face="Courier New, Courier" color="#3F7F7F">
tr:commandNavigationItem
</font><font face="Courier New, Courier" color="#7F007F">text</font>
<font face="Courier New, Courier">=</font>
<font face="Courier New, Courier" color="#2A00FF">&quot;Quad Based&quot;
</font><font face="Courier New, Courier" color="#7F007F">selected</font>
<font face="Courier New, Courier">
=&quot;#{tabNavigationBean.quadBased}&quot;
</font><font face="Courier New, Courier" color="#7F007F">
actionListener</font><font face="Courier New, Courier">
=&quot;#{exRABean.laserDiagnosticsQuadBasedAction}&quot;
</font><font face="Courier New, Courier" color="#7F007F">rendered</font>
<font face="Courier New, Courier">
=&quot;#{navigationBean.laserDiagnostics}&quot;</font>
<font face="Courier New, Courier" color="#008080">&gt;&lt;/</font>
<font face="Courier New, Courier" color="#3F7F7F">
tr:commandNavigationItem</font>
<font face="Courier New, Courier" color="#008080">&gt;<br>
...<br><br>
</font>The actionListener is being called, but not the wrapper
action-listener defined in faces-config.xml.<br>
I use similar things in other places and it works just fine.<br><br>
This seems to happen when an underlying database table isn't there.&nbsp;
Perhaps Spring/JPA is getting in the way?</blockquote><br>
------------------------------------------------<br><br>
import java.lang.reflect.Method;<br><br>
public class ExceptionUtils {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
private ExceptionUtils() {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
}<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; /**<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; * Iterates through all root exceptions for the throwable
entry and looks for<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; * an exception that matches the given class (clazz). If this
exception was<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; * caused buy an exception of type clazz, that root exception
is returned<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; * <br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; * @param cause<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; * @param clazz<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; * @return<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp; */<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
public static Throwable getException(Throwable cause, Class clazz) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; Throwable throwable = null;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; do {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Throwable nextCause;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Method rootCause =
cause.getClass().getMethod(&quot;getRootCause&quot;, new Class[]
{});<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nextCause = (Throwable)
rootCause.invoke(cause, new Object[] {});<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (Exception e) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nextCause =
cause.getCause();<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (cause == nextCause) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nextCause != null &amp;&amp;
nextCause.getClass().equals(clazz)) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throwable = nextCause;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cause = nextCause;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; } while (cause != null);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; return throwable;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
}<br><br>
<br>
}<br>
-----------------------------------------<br><br>
package gov.llnl.nif.dataviz.actionlistener.exceptionhandler;<br><br>
import java.sql.SQLException;<br><br>
import javax.faces.FacesException;<br>
import javax.faces.application.FacesMessage;<br>
import javax.faces.context.FacesContext;<br>
import javax.faces.event.AbortProcessingException;<br>
import javax.faces.event.ActionEvent;<br><br>
import oracle.toplink.essentials.exceptions.DatabaseException;<br><br>
import org.apache.log4j.Logger;<br>
import org.apache.myfaces.application.ActionListenerImpl;<br><br>
public class ExceptionHandlingActionListener extends ActionListenerImpl
{<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab> private
static Logger log =
Logger.getLogger(ExceptionHandlingActionListener.class);<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
public String oneLiner(String s) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; String []
lines = s.split(&quot;[\r\n]+&quot;);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
StringBuilder sb = new StringBuilder();<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; for
(String line : lines) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
sb.append(line);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; }<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; return
sb.toString();<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
}<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
public void processAction(ActionEvent event) throws
AbortProcessingException {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; FacesContext facesContext =
FacesContext.getCurrentInstance();<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; try {<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super.processAction(event);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; } catch (FacesException fe)
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Throwable databaseException =
ExceptionUtils.getException(fe, DatabaseException.class);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (databaseException != null) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FacesMessage facesMessage = new
FacesMessage(FacesMessage.SEVERITY_ERROR,&quot;Database
Error&quot;,oneLiner(databaseException.getMessage()));<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; facesContext.addMessage(null,
facesMessage);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
databaseException = ExceptionUtils.getException(fe,
SQLException.class);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
(databaseException != null) {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,
&quot;SQL Database error&quot;,
oneLiner(databaseException.getMessage()));<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
facesContext.addMessage(null, facesMessage);<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
throw fe;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>
&nbsp;&nbsp;&nbsp; }<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;
}<br><br>
}<br>
----------------------------------------<br>
from faces-config.xml<br><br>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">application</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
action-listener</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
gov.llnl.nif.dataviz.actionlistener.exceptionhandler.ExceptionHandlingActionListener<br>
&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
action-listener</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;<br>
&nbsp;</font><font face="Arial, Helvetica" size=4 color="#0000FF">
&lt;</font><font face="Arial, Helvetica" size=4 color="#800000">
default-render-kit-id</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>
org.apache.myfaces.trinidad.core</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
default-render-kit-id</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
&lt;</font><font face="Arial, Helvetica" size=4 color="#800000">
variable-resolver</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>
org.springframework.web.jsf.DelegatingVariableResolver</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
variable-resolver</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;!--</font>
<font face="Arial, Helvetica" size=4 color="#808080">&nbsp;&nbsp;&nbsp;
&lt;navigation-handler&gt;org.springframework.webflow.executor.jsf.FlowNavigationHandler&lt;/navigation-handler&gt;<br>
&nbsp;
&lt;variable-resolver&gt;org.springframework.webflow.executor.jsf.DelegatingFlowVariableResolver&lt;/variable-resolver&gt;</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">--&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">locale-config</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">default-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>en</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">default-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>en</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>es</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>de</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>fr</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>nl</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>pt_BR</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;
</font><font face="Arial, Helvetica" size=4 color="#0000FF">&lt;</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;</font>
<font face="Arial, Helvetica" size=4>zh_CN</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">
supported-locale</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
</font><font face="Arial, Helvetica" size=4>&nbsp;</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&lt;/</font>
<font face="Arial, Helvetica" size=4 color="#800000">locale-config</font>
<font face="Arial, Helvetica" size=4 color="#0000FF">&gt;<br>
&lt;/</font><font face="Arial, Helvetica" size=4 color="#800000">
application</font><font face="Arial, Helvetica" size=4 color="#0000FF">
&gt;</font></body>
</html>

From adffaces-user-return-margaretmorrison@example.net Thu Dec 27 19:55:12 2007
Return-Path: <adffaces-user-return-margaretmorrison@example.net>
Delivered-To: margaretmorrison@example.net
Received: (qmail 95932 invoked from network); 27 Dec 2007 19:55:12 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 27 Dec 2007 19:55:12 -0000
Received: (qmail 98334 invoked by uid 500); 27 Dec 2007 19:55:01 -0000
Delivered-To: margaretmorrison@example.net
Received: (qmail 98327 invoked by uid 500); 27 Dec 2007 19:55:00 -0000
Mailing-List: contact margaretmorrison@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:margaretmorrison@example.net>
List-Unsubscribe: <mailto:margaretmorrison@example.net>
List-Post: <mailto:margaretmorrison@example.net>
List-Id: <adffaces-user.incubator.apache.org>
Reply-To: margaretmorrison@example.net
Delivered-To: mailing list margaretmorrison@example.net
Received: (qmail 98302 invoked by uid 99); 27 Dec 2007 19:55:00 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2007 11:55:00 -0800
X-ASF-Spam-Status: No, hits=-0.3 required=10.0
	tests=HTML_MESSAGE,MIME_HTML_ONLY,RCVD_IN_DNSWL_MED,SPF_PASS
X-Spam-Check-By: apache.org
Received-SPF: pass (nike.apache.org: local policy)
Received: from [83.161.120.155] (HELO nspiron-2.llnl.gov) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2007 19:54:49 +0000
X-Attachments: None
X-IronPort-AV: E=McAfee;i="5100,188,5194"; a="5363150"
X-IronPort-AV: E=Sophos;i="4.24,212,1196668800"; 
   d="scan'208,217";a="5363150"
Received: from carlson14-ltp.llnl.gov ([83.161.120.155])
  by nspiron-2.llnl.gov with ESMTP; 27 Dec 2007 11:54:39 -0800
Message-Id: <margaretmorrison@example.net>
X-Mailer: QUALCOMM Windows Eudora Version 83.161.120.155
Date: Thu, 27 Dec 2007 11:54:37 -0800
To: margaretmorrison@example.net
From: John Carlson <margaretmorrison@example.net>
Subject: wrapper action-listener not being called
Mime-Version: 1.0
Content-Type: text/html; charset="us-ascii"
X-Virus-Checked: Checked by ClamAV on apache.org

<html>
<body>
I defined an action-listener in my faces-config.xml.&nbsp; Sometimes it
is being called, and sometimes it isn't.&nbsp; When it isn't called,
there is a DatabaseException (missing table or view).&nbsp; I have tried
putting in println's and it's definite that the first line of the
processAction isn't being called.&nbsp; I'm using myfaces, tomahawk and
trinidad.&nbsp; The tag that fails is:<br>
<font face="Courier New, Courier" color="#008080">&lt;</font>
<font face="Courier New, Courier" color="#3F7F7F">tr:navigationPane
</font><font face="Courier New, Courier" color="#7F007F">hint</font>
<font face="Courier New, Courier">=</font>
<font face="Courier New, Courier" color="#2A00FF">&quot;tabs&quot;</font>
<font face="Courier New, Courier" color="#008080">&gt;<br>
&lt;</font><font face="Courier New, Courier" color="#3F7F7F">
tr:commandNavigationItem
</font><font face="Courier New, Courier" color="#7F007F">text</font>
<font face="Courier New, Courier">=</font>
<font face="Courier New, Courier" color="#2A00FF">&quot;Quad Based&quot;
</font><font face="Courier New, Courier" color="#7F007F">selected</font>
<font face="Courier New, Courier">
=&quot;#{tabNavigationBean.quadBased}&quot;
</font><font face="Courier New, Courier" color="#7F007F">
actionListener</font><font face="Courier New, Courier">
=&quot;#{exRABean.laserDiagnosticsQuadBasedAction}&quot;
</font><font face="Courier New, Courier" color="#7F007F">rendered</font>
<font face="Courier New, Courier">
=&quot;#{navigationBean.laserDiagnostics}&quot;</font>
<font face="Courier New, Courier" color="#008080">&gt;&lt;/</font>
<font face="Courier New, Courier" color="#3F7F7F">
tr:commandNavigationItem</font>
<font face="Courier New, Courier" color="#008080">&gt;<br><br>
</font><font face="Courier New, Courier">Other tags like this work
fine.&nbsp; Note that laserDiagnosticsQuadBasedAction(ActionEvent) is
being called.<br><br>
John</font></body>
</html>


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