Return-Path: Delivered-To: apmail-incubator-jspwiki-dev-archive@locus.apache.org Received: (qmail 6024 invoked from network); 27 Jan 2008 22:33:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jan 2008 22:33:55 -0000 Received: (qmail 6660 invoked by uid 500); 27 Jan 2008 22:33:46 -0000 Delivered-To: apmail-incubator-jspwiki-dev-archive@incubator.apache.org Received: (qmail 6646 invoked by uid 500); 27 Jan 2008 22:33:46 -0000 Mailing-List: contact jspwiki-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-dev@incubator.apache.org Received: (qmail 6637 invoked by uid 99); 27 Jan 2008 22:33:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Jan 2008 14:33:45 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Jan 2008 22:33:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 422A6714201 for ; Sun, 27 Jan 2008 14:33:34 -0800 (PST) Message-ID: <30540790.1201473214260.JavaMail.jira@brutus> Date: Sun, 27 Jan 2008 14:33:34 -0800 (PST) From: "Dave Wolf (JIRA)" To: jspwiki-dev@incubator.apache.org Subject: [jira] Commented: (JSPWIKI-166) NullPointerException when mail.from property is omitted/commented out In-Reply-To: <26775130.1201427255516.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JSPWIKI-166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12563029#action_12563029 ] Dave Wolf commented on JSPWIKI-166: ----------------------------------- >From MailUtil: 302 if (c_useJndi) 303 { 304 // Try getting the Session from the JNDI factory first 305 try 306 { 307 session = getJNDIMailSession(jndiName); 308 c_useJndi = false; 309 } 310 catch (NamingException e) 311 { 312 // Oops! JNDI factory must not be set up 313 } 314 } Shouldn't line 308 be moved inside the catch? > NullPointerException when mail.from property is omitted/commented out > --------------------------------------------------------------------- > > Key: JSPWIKI-166 > URL: https://issues.apache.org/jira/browse/JSPWIKI-166 > Project: JSPWiki > Issue Type: Bug > Components: Core & storage > Affects Versions: 2.6.1 > Reporter: Florian Holeczek > Priority: Minor > Fix For: 2.6.1 > > > In line 266 of MailUtil.java: > {code}String from = engine.getWikiProperties().getProperty( PROP_MAIL_SENDER ).trim();{code} > If this property isn't defined, getProperty returns null. > Apart from fixing this, it would be fine to redesign the comments in jspwiki.properties and let the admin know that mail.from must be defined in each case, whether jndi mail or custom mail is defined. > Hint to a more general approach: > I've seen that Properties can have a set of default properties. Doesn't JSPWiki use this feature? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.