Skip to content

Commit

Permalink
Add error logging/exception for failure to find valve.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoleman committed Apr 16, 2012
1 parent 66ce523 commit 1025b73
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,23 @@ protected synchronized void startInternal() throws LifecycleException {

setState(LifecycleState.STARTING);

Boolean attachedToValve = false;
for (Valve valve : getContainer().getPipeline().getValves()) {
if (valve instanceof RedisSessionHandlerValve) {
this.handlerValve = (RedisSessionHandlerValve) valve;
this.handlerValve.setRedisSessionManager(this);
log.info("Attached to RedisSessionHandlerValve");
attachedToValve = true;
break;
}
}

if (!attachedToValve) {
String error = "Unable to attach to session handling valve; sessions cannot be saved after the request without the valve starting properly.";
log.fatal(error);
throw new LifecycleException(error);
}

try {
initializeSerializer();
} catch (ClassNotFoundException e) {
Expand Down

0 comments on commit 1025b73

Please sign in to comment.