Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 376C9648E for ; Fri, 3 Jun 2011 09:02:51 +0000 (UTC) Received: (qmail 17648 invoked by uid 500); 3 Jun 2011 09:02:50 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 17492 invoked by uid 500); 3 Jun 2011 09:02:50 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 17483 invoked by uid 99); 3 Jun 2011 09:02:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 09:02:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 09:02:49 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id AF7C94893F; Fri, 3 Jun 2011 09:02:08 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 51315] New: Removing Valve from StandardContext causes IllegalArgumentException Date: Fri, 03 Jun 2011 09:02:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 6 X-Bugzilla-Component: Catalina X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: violetagg@apache.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: default X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=51315 Bug #: 51315 Summary: Removing Valve from StandardContext causes IllegalArgumentException Product: Tomcat 6 Version: 6.0.32 Platform: PC Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: violetagg@apache.org Classification: Unclassified Hello, I have the following scenario - runtime I want to remove one Valve from a specified StandardContext. I'm using the following method: org.apache.catalina.core.StandardContext.removeValve(Valve valve) which invokes org.apache.catalina.core.StandardPipeline.removeValve(Valve valve) The problem is that the following exception is thrown: Caused by: java.lang.IllegalArgumentException: Configuration error: Must be attached to a Context at org.apache.catalina.authenticator.AuthenticatorBase.setContainer(AuthenticatorBase.java:277) at org.apache.catalina.core.StandardPipeline.removeValve(StandardPipeline.java:537) It appears that setContainer is invoked with "null" which leads to this IlleagalArgumentException. I want to propose the following change: Index: AuthenticatorBase.java =================================================================== --- AuthenticatorBase.java (revision 1100912) +++ AuthenticatorBase.java (working copy) @@ -273,7 +273,7 @@ */ public void setContainer(Container container) { - if (!(container instanceof Context)) + if (container != null && !(container instanceof Context)) throw new IllegalArgumentException (sm.getString("authenticator.notContext")); Please tell me if there is more appropriate way to remove a Valve if the one above that I'm describing is not the correct one. Thanks in advance. Regards Violeta Georgieva -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org