org.openejb.util
Class OpenEJBErrorHandler

java.lang.Object
  extended by org.openejb.util.OpenEJBErrorHandler

public class OpenEJBErrorHandler
extends java.lang.Object


Constructor Summary
OpenEJBErrorHandler()
           
 
Method Summary
static void classCodebaseNotFound(java.lang.String systemLocation, java.lang.String className, java.lang.String codebase, java.lang.Exception e)
          The {0} cannot locate the class {1}, the codebase '{2}' cannot be accessed.
static void classNotAccessible(java.lang.String systemLocation, java.lang.String className)
          Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class '{1}', the class or initializer is not accessible." {0} part of the system that needs the class {1} class that cannot be accessed.
static void classNotFound(java.lang.String systemLocation, java.lang.String className)
          Creates and throws an OpenEJBException with the following message: "The {0} cannot find and load the class '{1}'." {0} part of the system that needs the class {1} class that cannot be found.
static void classNotIntantiateable(java.lang.String systemLocation, java.lang.String className)
          Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class '{1}', the class may be abstract or an interface." {0} part of the system that needs the class {1} class that cannot be accessed.
static void classNotIntantiateableForUnknownReason(java.lang.String systemLocation, java.lang.String className, java.lang.String exceptionClassName, java.lang.String message)
          Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class {1}: Recieved exception {2}: {3}" {0} part of the system that needs the class {1} class that cannot be accessed.
static void classNotIntantiateableFromCodebaseForUnknownReason(java.lang.String systemLocation, java.lang.String className, java.lang.String codebase, java.lang.String exceptionClassName, java.lang.String message)
          Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class {1} loaded from codebase {2}: Recieved exception {3}: {4}" {0} part of the system that needs the class {1} class that cannot be accessed.
static void configurationParsingError(java.lang.String messageType, java.lang.String message, java.lang.String line, java.lang.String column)
          Creates and throws an OpenEJBException with the following message: "Error in XML configuration file.
static void handleUnknownError(java.lang.Throwable error, java.lang.String systemLocation)
          This method is only intended for situations where an unknown error or exception may occur and have fatal results.
static void propertiesObjectIsNull(java.lang.String systemLocation)
          Creates and throws an OpenEJBException with the following message: "The required properties object needed by {0} is null ." {1} is the part of the system that needs the properties object.
static void propertyFileNotFound(java.lang.String propertyfileName, java.lang.String systemLocation)
          Creates and throws an OpenEJBException with the following message: "Properties file '{0}' for {1} not found." {0} is the properties file name {1} is the part of the system that needs the properties file.
static void propertyNotFound(java.lang.String propertyName, java.lang.String propertyfileName)
          Creates and throws an OpenEJBException with the following message: "Environment entry '{0}' not found in {1}." {0} is the property name {1} is the properties file name.
static void propertyValueIsIllegal(java.lang.String propertyName, java.lang.String value)
          Creates and throws an OpenEJBException with the following message: "Environment entry '{0}' contains illegal value {1}." {0} is the property name {1} is the illegal value.
static void propertyValueIsIllegal(java.lang.String propertyName, java.lang.String value, java.lang.String message)
          Creates and throws an OpenEJBException with the following message: "Environment entry '{0}' contains illegal value {1}.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenEJBErrorHandler

public OpenEJBErrorHandler()
Method Detail

handleUnknownError

public static void handleUnknownError(java.lang.Throwable error,
                                      java.lang.String systemLocation)
This method is only intended for situations where an unknown error or exception may occur and have fatal results. Example use:
 public ContainerSystem build() throws AssemblerException{
     try{
         return (org.openejb.ContainerSystem)assembleContainerSystem(config);
     }catch(AssemblerException ae){
         // AssemblerExceptions contain useful information and are debbugable.
         // Let the exception pass through to the top and be logged.
          throw ae;
     }catch(Exception e){
         // General Exceptions at this level are too generic and difficult to debug.
         // These exceptions are considered unknown bugs and are fatal.
         OpenEJBErrorHandler.handleUnknownError(e, "Assembler");
     }
 }
 
Creates and logs an OpenEJBException with the following message: "FATAL ERROR: Unknown error in {0}. Please send the following stack trace and this message to openejb-bugs@exolab.org :\n {1}"} {0} is the part of the system that the error occurred.

Parameters:
error - the unknown Throwable that occurred.
systemLocation - replaces {0} in the error message.

propertiesObjectIsNull

public static void propertiesObjectIsNull(java.lang.String systemLocation)
                                   throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "The required properties object needed by {0} is null ." {1} is the part of the system that needs the properties object.

Parameters:
systemLocation - replaces {0} in the error message.
Throws:
OpenEJBException

propertyFileNotFound

public static void propertyFileNotFound(java.lang.String propertyfileName,
                                        java.lang.String systemLocation)
                                 throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "Properties file '{0}' for {1} not found." {0} is the properties file name {1} is the part of the system that needs the properties file.

Parameters:
propertyfileName - replaces {0} in the error message.
systemLocation - replaces {1} in the error message.
Throws:
OpenEJBException

propertyNotFound

public static void propertyNotFound(java.lang.String propertyName,
                                    java.lang.String propertyfileName)
                             throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "Environment entry '{0}' not found in {1}." {0} is the property name {1} is the properties file name.

Parameters:
propertyName - replaces {0} in the error message.
propertyfileName - replaces {1} in the error message.
Throws:
OpenEJBException

propertyValueIsIllegal

public static void propertyValueIsIllegal(java.lang.String propertyName,
                                          java.lang.String value)
                                   throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "Environment entry '{0}' contains illegal value {1}." {0} is the property name {1} is the illegal value.

Parameters:
propertyName - replaces {0} in the error message.
value - replaces {1} in the error message.
Throws:
OpenEJBException

propertyValueIsIllegal

public static void propertyValueIsIllegal(java.lang.String propertyName,
                                          java.lang.String value,
                                          java.lang.String message)
                                   throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "Environment entry '{0}' contains illegal value {1}. {2}" {0} is the property name {1} is the illegal value. {2} an additional message.

Parameters:
propertyName - replaces {0} in the error message.
value - replaces {1} in the error message.
message - replaces {2} in the error message.
Throws:
OpenEJBException

classNotFound

public static void classNotFound(java.lang.String systemLocation,
                                 java.lang.String className)
                          throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "The {0} cannot find and load the class '{1}'." {0} part of the system that needs the class {1} class that cannot be found.

Parameters:
systemLocation - replaces {0} in the error message.
className - replaces {1} in the error message.
Throws:
OpenEJBException

classNotAccessible

public static void classNotAccessible(java.lang.String systemLocation,
                                      java.lang.String className)
                               throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class '{1}', the class or initializer is not accessible." {0} part of the system that needs the class {1} class that cannot be accessed.

Parameters:
systemLocation - replaces {0} in the error message.
className - replaces {1} in the error message.
Throws:
OpenEJBException

classNotIntantiateable

public static void classNotIntantiateable(java.lang.String systemLocation,
                                          java.lang.String className)
                                   throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class '{1}', the class may be abstract or an interface." {0} part of the system that needs the class {1} class that cannot be accessed.

Parameters:
systemLocation - replaces {0} in the error message.
className - replaces {1} in the error message.
Throws:
OpenEJBException

classNotIntantiateableForUnknownReason

public static void classNotIntantiateableForUnknownReason(java.lang.String systemLocation,
                                                          java.lang.String className,
                                                          java.lang.String exceptionClassName,
                                                          java.lang.String message)
                                                   throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class {1}: Recieved exception {2}: {3}" {0} part of the system that needs the class {1} class that cannot be accessed. {2} name of caught exception {3} message from caught exception

Parameters:
systemLocation - replaces {0} in the error message.
className - replaces {1} in the error message.
exceptionClassName - replaces {2} in the error message.
message - replaces {3} in the error message.
Throws:
OpenEJBException

classNotIntantiateableFromCodebaseForUnknownReason

public static void classNotIntantiateableFromCodebaseForUnknownReason(java.lang.String systemLocation,
                                                                      java.lang.String className,
                                                                      java.lang.String codebase,
                                                                      java.lang.String exceptionClassName,
                                                                      java.lang.String message)
                                                               throws OpenEJBException
Creates and throws an OpenEJBException with the following message: "The {0} cannot instaniate the class {1} loaded from codebase {2}: Recieved exception {3}: {4}" {0} part of the system that needs the class {1} class that cannot be accessed. {2} codebase the class was loaded from {3} name of caught exception {4} message from caught exception

Parameters:
systemLocation - replaces {0} in the error message.
className - replaces {1} in the error message.
codebase - replaces {2} in the error message.
exceptionClassName - replaces {3} in the error message.
message - replaces {4} in the error message.
Throws:
OpenEJBException

classCodebaseNotFound

public static void classCodebaseNotFound(java.lang.String systemLocation,
                                         java.lang.String className,
                                         java.lang.String codebase,
                                         java.lang.Exception e)
                                  throws OpenEJBException
The {0} cannot locate the class {1}, the codebase '{2}' cannot be accessed. Received message: {3}"

Parameters:
systemLocation - replaces {0} in the error message.
className - replaces {1} in the error message.
codebase - replaces {2} in the error message.
e - e.getMessage() replaces {3} in the error message.
Throws:
OpenEJBException

configurationParsingError

public static void configurationParsingError(java.lang.String messageType,
                                             java.lang.String message,
                                             java.lang.String line,
                                             java.lang.String column)
Creates and throws an OpenEJBException with the following message: "Error in XML configuration file. Received {0} from the parser stating '{1}' at line {2} column {3}."}, {0} the type of message. {1} the error message from the parser. {2} the line number. {3} the column number.

Parameters:
messageType - replaces {0} in the error message.
message - replaces {1} in the error message.
line - replaces {2} in the error message.
column - replaces {3} in the error message.


Copyright © 1999-2011 OpenEJB. All Rights Reserved.