Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 7943 invoked from network); 26 Sep 2008 01:04:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Sep 2008 01:04:57 -0000 Received: (qmail 3392 invoked by uid 500); 26 Sep 2008 01:04:45 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 3366 invoked by uid 500); 26 Sep 2008 01:04:45 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 3355 invoked by uid 99); 26 Sep 2008 01:04:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2008 18:04:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=FORGED_MUA_OUTLOOK,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of martin@growebs.com.ar designates 200.58.119.36 as permitted sender) Received: from [200.58.119.36] (HELO atenas.dattaweb.com) (200.58.119.36) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2008 01:03:41 +0000 Received: from [200.69.27.213] (helo=marto) by atenas.dattaweb.com with esmtpa (Exim 4.63) (envelope-from ) id 1Kj1kh-0008Ki-GX for user@struts.apache.org; Thu, 25 Sep 2008 22:04:12 -0300 Message-ID: From: =?iso-8859-1?Q?Mart=EDn_Mauri?= To: References: <8D07BC62C6AC4B5E81D62C698747394F@marto> Subject: Re: ApplicationListener issue Date: Thu, 25 Sep 2008 22:04:03 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Spam-Score: -0.3 X-Spam-Score-Int: -2 X-Spam-Bar: / X-Spam-Report: Spam detection software, running on the system "atenas.dattaweb.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Laurie, I've checked all the points that you suggested, and I think that #3 could be a possibility. The thing is that the database object is not null when I do the context.setAttribute(DATABASE_KEY, database); But in the Action that implements the ApplicationAware interface I did the following: Inside the method that gets invoked I did: Map application = getApplication(); and it turned out to be that the application object is null. Am I missing something in the configuration files? Is it required to do an interceptor to transfer this object from the Application Listener to my Action class? [...] Content analysis details: (-0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0002] 4.1 FORGED_MUA_OUTLOOK Forged mail pretending to be from MS Outlook X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - atenas.dattaweb.com X-AntiAbuse: Original Domain - struts.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [502 502] X-AntiAbuse: Sender Address Domain - growebs.com.ar X-Virus-Checked: Checked by ClamAV on apache.org Hi Laurie, I've checked all the points that you suggested, and I think that #3 could be a possibility. The thing is that the database object is not null when I do the context.setAttribute(DATABASE_KEY, database); But in the Action that implements the ApplicationAware interface I did the following: Inside the method that gets invoked I did: Map application = getApplication(); and it turned out to be that the application object is null. Am I missing something in the configuration files? Is it required to do an interceptor to transfer this object from the Application Listener to my Action class? I'll appreciate your help, Thank you. Martin ----- Original Message ----- From: "Laurie Harper" To: Sent: Thursday, September 25, 2008 4:45 AM Subject: Re: ApplicationListener issue Mart�n Mauri wrote: > Hi all, > I'm having an issue while implementing an App Listener for my App. > Thing is that the ApplicationListener appears to be working fine, as from > the logs I can see that the contextInitialized method is being invoked. > > Inside the method I do this call, same way as the Mailreader sample app > does: > > context.setAttribute(DATABASE_KEY, database); > The problem comes when from my action: > > public class MyAction extends ActionSupport implements ApplicationAware { > > public DBConnector getDatabase() { > > Map application = getApplication(); > > Object db = application.get(DATABASE_KEY); > > .... > > } > > db is returning null, like if the object got lost somewhere... > > here's the fragmen of my web.xml: > > > > > > myApp.ApplicationListener > > > > > > Any ideas? 1) there's something wrong in your implementation of ApplicationAware and/or your getApplication() method 2) the 'database' variable was null when you called setAttribute() in your listener 3) you have code somewhere which is overwriting the application-scope property with a null value after the listener initializes it 4) the value of DATABASE_KEY is different in the listener and the action Those are the most obvious places to start. In fact, I can't think of anything else it could be unless there's something very funky going on, in which case I doubt it can be diagnosed through a mailing list... L. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org __________ Informaci�n de NOD32, revisi�n 3469 (20080924) __________ Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org