From derby-dev-return-56295-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Mon Mar 03 10:27:57 2008 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 35708 invoked from network); 3 Mar 2008 10:27:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2008 10:27:56 -0000 Received: (qmail 70316 invoked by uid 500); 3 Mar 2008 10:27:52 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 70280 invoked by uid 500); 3 Mar 2008 10:27:52 -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 70270 invoked by uid 99); 3 Mar 2008 10:27:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 02:27:52 -0800 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, 03 Mar 2008 10:27:25 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6FCC1234C083 for ; Mon, 3 Mar 2008 02:26:50 -0800 (PST) Message-ID: <925302061.1204540010456.JavaMail.jira@brutus> Date: Mon, 3 Mar 2008 02:26:50 -0800 (PST) From: =?utf-8?Q?=C3=98ystein_Gr=C3=B8vlen_=28JIRA=29?= To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3454) 'java.lang.NullPointerException' is thrown when starting a master db before a slave one In-Reply-To: <515858619.1203765439969.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3454?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1257= 4414#action_12574414 ]=20 =C3=98ystein Gr=C3=B8vlen commented on DERBY-3454: ---------------------------------------- Thanks for the patch, Narayanan. Looks good. Committed as revision 633026= . > 'java.lang.NullPointerException' is thrown when starting a master db befo= re a slave one > -------------------------------------------------------------------------= -------------- > > Key: DERBY-3454 > URL: https://issues.apache.org/jira/browse/DERBY-3454 > Project: Derby > Issue Type: Bug > Components: Replication > Affects Versions: 10.4.0.0 > Reporter: Serge Tsv > Assignee: V.Narayanan > Attachments: Derby3454.diff, Derby3454.stat > > > The 'java.lang.NullPointerException' exception is thrown when a database = is started in a master mode and is trying to establish a connection to an s= lave database socket, which is not available. > The exception is by the MasterController#startMaster(). First, it tries t= o setup connection with a slave database using a transmitter: > MasterController#setupConnection > -> transmitter =3D new ReplicationMessageTransmit();=20 > transmitter.initConnection() > -> new InetSocketAddress() -> createSocket() -> connect() > The connect() method throws a ConnectException, and so fails to create a = socketConn instance. The exception is then wrapped several times an propaga= ted back to the MasterController#startMaster() method. It's caught there an= d then a MasterController#teardownNetwork() method is called, which tries t= o send a STOP message using the aforementioned transmitter, which hasn't be= en able to init a connection.=20 > A transmitter simply tries to call socketConn.writeMessage(message), whic= h throws NPE because socketConn is null. > Thanks! --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.