[ 
https://issues.apache.org/jira/browse/GEODE-3944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16236226#comment-16236226
 ] 

Patrick Rhomberg edited comment on GEODE-3944 at 11/2/17 5:38 PM:
------------------------------------------------------------------

> Probably, the best fix would be to catch {{Throwable}} instead of 
> {{Exception}}.

Remember that {{Throwable}} parents {{Error}}, which should generally not be 
caught except for logging before death, per its own documentation.

{quote}
public class Error
extends Throwable

An Error is a subclass of Throwable that indicates serious problems that a 
reasonable application should not try to catch. Most such errors are abnormal 
conditions. The ThreadDeath error, though a "normal" condition, is also a 
subclass of Error because most applications should not try to catch it.
{quote}
[Error docs|https://docs.oracle.com/javase/8/docs/api/java/lang/Error.html]


was (Author: prhomberg):
> Probably, the best fix would be to catch {{Throwable}} instead of 
> {{Exception}}.

Remember that {{Throwable}} parents {{Error}}, which should generally not be 
caught except for logging before death, per its own documentation.

{quote}
public class Error
extends Throwable

An Error is a subclass of Throwable that indicates serious problems that a 
reasonable application should not try to catch. Most such errors are abnormal 
conditions. The ThreadDeath error, though a "normal" condition, is also a 
subclass of Error because most applications should not try to catch it.

A method is not required to declare in its throws clause any subclasses of 
Error that might be thrown during the execution of the method but not caught, 
since these errors are abnormal conditions that should never occur. That is, 
Error and its subclasses are regarded as unchecked exceptions for the purposes 
of compile-time checking of exceptions.
{quote}

> Geode node is not able to start normally without spring-shell library anymore
> -----------------------------------------------------------------------------
>
>                 Key: GEODE-3944
>                 URL: https://issues.apache.org/jira/browse/GEODE-3944
>             Project: Geode
>          Issue Type: Bug
>          Components: core, management
>            Reporter: Vadim Lotarev
>             Fix For: 1.3.0
>
>
> Starting from version 1.3.0 Geode cache is not able to start normally if 
> spring-shell library is not available. This library is needed in order to 
> implement gfsh commands and should not be required for any node. Everything 
> worked just fine until new class {{OnlineCommandProcessor}} is introduced. 
> Now, when attempt to create it failed (because of absence of spring-shell) 
> {{java.lang.NoClassDefFoundError: org/springframework/shell/core/Parser}} is 
> fired. This class is not an {{Exception}} so the following catch block is 
> skipped and MemberMBean (as well as ManagementService) is not initialized as 
> a result:
> {code}
>     try {
>       this.commandProcessor =
>           new OnlineCommandProcessor(system.getProperties(), 
> cache.getSecurityService());
>     } catch (Exception e) {
>       commandServiceInitError = e.getMessage();
>       logger.info(LogMarker.CONFIG, "Command processor could not be 
> initialized. {}",
>           e.getMessage());
>     }
> {code}
> Probably, the best fix would be to catch {{Throwable}} instead of 
> {{Exception}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to