geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject How to make minor deployment problems emit warnings rather than make the deployment fail?
Date Fri, 13 Jul 2007 18:33:02 GMT
Someone was having problems with their ear and our manifest classpath  
completion, they were getting an objection they had trouble  
understanding.  (GERONIMO-3316).  I've got the code so where it  
produces better messages, but I'm not quite sure the best way to  
provide an option to warn instead of stop.

I modified DeploymentException to take a list of causes, so at least  
we'll always get all the problems we find rather than just the  
first.  I'm wondering if an appropriate way to implement the warn/ 
throw behavior is a static field (set from a system property?????? or  
a gbean?????????) in DeploymentException and a factory method

public void warnOrThrow(String message, List<DeploymentException>  
causes, Log log) throws DeploymentException {
     if (causes.isEmpty()) {
     DeploymentException ex = new DeploymentException(message, causes);
     if (strict) {
         throw ex;
     } else {
         log.warn("Normally fatal deployment error:", ex);

I'm not completely thrilled with this idea but it seems sort of ok.   
Anyone have a better idea?

david jencks

View raw message