Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 49219 invoked from network); 19 Apr 2006 09:31:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Apr 2006 09:31:05 -0000 Received: (qmail 3090 invoked by uid 500); 19 Apr 2006 09:31:02 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 2859 invoked by uid 500); 19 Apr 2006 09:31:01 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 2848 invoked by uid 99); 19 Apr 2006 09:31:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Apr 2006 02:31:01 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Apr 2006 02:31:00 -0700 Received: from brutus (localhost.localdomain [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B640F7142D9 for ; Wed, 19 Apr 2006 09:30:00 +0000 (GMT) Message-ID: <17512781.1145439000743.JavaMail.jira@brutus> Date: Wed, 19 Apr 2006 09:30:00 +0000 (GMT+00:00) From: "Anders Morken (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1174) NullPointerException in network server with LDAP authentication In-Reply-To: <428983361.1143923010167.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1174?page=comments#action_12375081 ] Anders Morken commented on DERBY-1174: -------------------------------------- Agreed. My quickfix "return if it's null" isn't very pretty, but it worked for me when I played around in the debugger. But yes, I see that it could surprise someone later if code unrelated to dbProps was added below the conditional return. Thanks. =) An enlightening comment. Hm. I'm still not sure if I fixed the symptom or the the problem there. Is a null dbProps a normal situation when Derby is started with "create=true" in the jdbc connect string? Will it be null if you connect to an already created database without any database properties set? > NullPointerException in network server with LDAP authentication > --------------------------------------------------------------- > > Key: DERBY-1174 > URL: http://issues.apache.org/jira/browse/DERBY-1174 > Project: Derby > Type: Bug > Components: Network Server, Newcomer > Versions: 10.2.0.0, 10.1.2.1 > Environment: Linux x86 (Fedora Core 4), 1.4.2_09 Sun JVM > Reporter: Anders Morken > Assignee: Anders Morken > Priority: Minor > Attachments: DERBY-1174.patch, derby.log, derby.properties > > While trying to fix DERBY-1000 I tried to set up Derby's network server to use LDAP authentication, but I ran into something that looks like a bug, but could just as well be my own configuration mistake. I would appreciate any help in figuring this out. =) > The problem is a NullPointerException in the Network Server when it tries to initialize the LDAP authentication service. The attached derby.log shows the exception and its stacktrace. The attached derby.properties is what I put in the derby home directory. > I'm seeing this problem in the trunk as well as my own build of the 10.1 branch and the 10.1.2.1 release build available from the Derby web site. ( http://db.apache.org/derby/releases/release-10.1.2.1.cgi ) > The problem is cause by the setInitDirContextEnv method in JNDIAuthenticationSchemeBase receiving a null dbProps argument, which it obviously doesn't expect. Adding a check for a null dbProps argument and returning immediately after creating the initDirContextEnv object fixes the NullPointerException and makes LDAP authentication work for me. This is a reasonable enough robustness fix and shouldn't have any negative impact, but if the source of the problem is that JNDIAuthenticationSchemeBase should never receive that null pointer in the first place, more patching is needed. I'm not sure about this, so I'm leaving it up to the experts to decide this. =) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira