avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject Re: Fwd: [jira.werken.com] Created: (PNIX-2) Overly verbose exception messages
Date Sun, 02 Mar 2003 04:55:07 GMT

The avalon-sandbox/apliance package includes a utility class that 
addresses and resolves this issue.  The class is the ExceptionHelper 
class that provides support for the formatting and presentation of 
exception messages with causal infromation that takes into account both 
cascading and JSK 1.4 cause parameters.  

An example of the usage of the class in included here:

   try
   {
       // whatever
   }
   catch( Throwable e )
   {
       final String problem = "Some problem within Phoenix.";
       String error = ExceptionHelper.packException( problem , e );
       getLogger().error( error );
   }


The message register in the above example follows the pattern presented 
below (exception class and message followed by an orderly presentation 
of the execption cause and the stack trace of the root exception).

  [ERROR  ] (test): Message: error condition from xinfo: 
net.osm.test.DemoServantz
  ===================================================================

  Exception: org.apache.avalon.assembly.engine.EngineRuntimeException
  Unexpected error during type registration.

  Cause: org.apache.avalon.assembly.engine.type.TypeException
  Unexpected error while attempting to build a type from the classname: 
net.osm.test.DemoServantz

  Cause: java.lang.ClassNotFoundException
  net.osm.test.DemoServantz

  ===================================================================
  java.lang.ClassNotFoundException: net.osm.test.DemoServantz
        at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
        ... etc.

I can add the avalon-assembly.jar to pheonix/lib but perhaps you can 
point me to the code that acually handles the final reporting of error 
conditions.

Cheers, Steve.


Peter Donald wrote:

>----------  Forwarded Message  ----------
>
>Subject: [jira.werken.com] Created: (PNIX-2) Overly verbose exception messages
>Date: Sat, 1 Mar 2003 23:31:40 -0600
>From: bob@werken.com
>To: peter@realityforge.org
>
>Message:
>
>  A new issue has been created in JIRA.
>
>---------------------------------------------------------------------
>View the issue:
>
>  http://jira.werken.com/secure/ViewIssue.jspa?key=PNIX-2
>
>
>Here is an overview of the issue:
>---------------------------------------------------------------------
>        Key: PNIX-2
>    Summary: Overly verbose exception messages
>       Type: Bug
>
>     Status: Assigned
>   Priority: Minor
>
> Time Spent: Unknown
>   Estimate: 0 minutes
>
>    Project: phoenix
>  Component: None
>
>   Assignee: Peter Donald
>   Reporter: Peter Donald
>
>    Created: Sat, 1 Mar 2003 11:31 PM
>    Updated: Sat, 1 Mar 2003 11:31 PM
>
>Description:
>When an error occurs during startup Phoenix will print out the exception
> multiple times. Each exception displayed will also include nested exception
> - where usually you do not want to see any exception except those caused
> inside the application. Instead you can see systen oriented
> Deployment/Installation/Startup exceptions.
>
>This probalem is compounded on jdk1.4 which has the feature that
> printStackTrace already prints the nested exception. So each printStackTrace
> on JDK1.4 will print 2n! traces rather than 2n.
>
>
>---------------------------------------------------------------------
>JIRA INFORMATION:
>This message is automatically generated by JIRA.
>
>If you think it was sent incorrectly contact one of the administrators:
>   http://jira.werken.com/Administrators.jspa
>
>If you want more information on JIRA, or have a bug to report see:
>   http://www.atlassian.com/software/jira
>
>-------------------------------------------------------
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message