Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 56812 invoked from network); 7 Sep 2009 23:21:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Sep 2009 23:21:27 -0000 Received: (qmail 92145 invoked by uid 500); 7 Sep 2009 23:21:26 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 92043 invoked by uid 500); 7 Sep 2009 23:21:26 -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 92032 invoked by uid 99); 7 Sep 2009 23:21:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2009 23:21:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2009 23:21:22 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 087E3234C044; Mon, 7 Sep 2009 16:21:02 -0700 (PDT) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 47796] New: StandardContext's annotationProcessor field gets cached between webapp start/stop cycles 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: major X-Bugzilla-Who: 20090908@csokker.hu 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 Date: Mon, 7 Sep 2009 16:21:02 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=47796 Summary: StandardContext's annotationProcessor field gets cached between webapp start/stop cycles Product: Tomcat 6 Version: 6.0.20 Platform: PC OS/Version: Windows XP Status: NEW Severity: major Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: 20090908@csokker.hu --- Comment #0 from mrbrush <20090908@csokker.hu> 2009-09-07 16:21:00 PDT --- Created an attachment (id=24222) Patch file contatining the proposed fix When a webapp is stopped in tomcat, the annotationProcessor field does not get nullified. When the webapp is started again, the start() method of the StandardContext class checks whether the annotationProcessor field is null, and only builds a new one if so. This means that the annotationProcessor gets reused between application start/stop cycles (not tomcat restart cycles). Things that are dependent on the annotationProcessor (like injection, etc) may be broken because of this. One specific example is when using OpenEJB tomcat integration. The annotationProcesor itself holds a reference to a javax.naming.Context, which is cached between context start/stop cycles. This causes that after a stop/start cycle of a context, the annotationProcessor tries to inject the EJB reference proxies made at the first start of the context, which was made against different instances of the to-be-injected fields' classes. This results that the EJB injection is not working. Other types of injections may be broken too. Attached patch file containing the fix. Tested, works. -- 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