Derby
  1. Derby
  2. DERBY-3170

Connecting through network server after engine has been stopped causes NullPointerException on the server side

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.4.1.3
    • Fix Version/s: None
    • Component/s: Network Server
    • Environment:
      Solaris 10 x86, Sun JDK 1.6.
      svn revision 590939 (trunk).
    • Urgency:
      Normal
    • Issue & fix info:
      High Value Fix, Repro attached
    • Bug behavior facts:
      Embedded/Client difference

      Description

      While working on a port for a test that has to reset system properties, I discovered this problem. The test setup starts a networkserver in the same JVM as the test is running in, then stops the Derby engine and tries to connect to the database through the client driver and network server. This causes the following exception returned to the application:

      1) testRepro(org.apache.derbyTesting.functionTests.tests.lang.ReproTest)java.sql.SQLFeatureNotSupportedException: The DDM object 0x1232 is not supported. The connection has been terminated.
      at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
      at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
      at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
      at java.sql.DriverManager.getConnection(DriverManager.java:582)
      at java.sql.DriverManager.getConnection(DriverManager.java:185)
      at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:76)
      at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:43)
      at org.apache.derbyTesting.junit.TestConfiguration.openDefaultConnection(TestConfiguration.java:1030)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.openDefaultConnection(BaseJDBCTestCase.java:366)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.getConnection(BaseJDBCTestCase.java:102)
      at org.apache.derbyTesting.functionTests.tests.lang.ReproTest.testRepro(ReproTest.java:48)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:95)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      Caused by: org.apache.derby.client.am.DisconnectException: The DDM object 0x1232 is not supported. The connection has been terminated.
      at org.apache.derby.client.net.NetConnectionReply.doObjnsprmSemantics(Unknown Source)
      at org.apache.derby.client.net.NetConnectionReply.parseCommonError(Unknown Source)
      at org.apache.derby.client.net.NetConnectionReply.parseSecurityCheckError(Unknown Source)
      at org.apache.derby.client.net.NetConnectionReply.parseSECCHKreply(Unknown Source)
      at org.apache.derby.client.net.NetConnectionReply.readSecurityCheck(Unknown Source)
      at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source)
      at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown Source)
      at org.apache.derby.client.net.NetConnection.flowUSRIDPWDconnect(Unknown Source)
      at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source)
      at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
      at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
      at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
      ... 32 more

      On the server side I see a NullPointerException:

      Apache Derby Network Server - 10.4.0.0 alpha - (590618M) started and ready to accept connections on port 1527 at 2007-11-01 08:38:37.605 GMT
      null
      java.lang.NullPointerException
      at org.apache.derby.impl.drda.DRDAConnThread.isAuthenticationException(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
      Execution failed because of Permanent Agent Error: SVRCOD = 40; RDBNAM = wombat; diagnostic msg = null
      org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of Permanent Agent Error: SVRCOD = 40; RDBNAM = wombat; diagnostic msg = null
      at org.apache.derby.impl.drda.DRDAProtocolException.newAgentError(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.sendUnexpectedException(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.handleException(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
      null
      java.lang.NullPointerException
      at org.apache.derby.impl.drda.DRDAConnThread.isAuthenticationException(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
      at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
      Apache Derby Network Server - 10.4.0.0 alpha - (590618M) shutdown at 2007-11-01 08:38:38.318 GMT

      The class below is a test for the JUnit framework that reproduces the problem.

      /*

      Derby - Class org.apache.derbyTesting.functionTests.tests.lang.logStream

      Licensed to the Apache Software Foundation (ASF) under one or more
      contributor license agreements. See the NOTICE file distributed with
      this work for additional information regarding copyright ownership.
      The ASF licenses this file to You under the Apache License, Version 2.0
      (the "License"); you may not use this file except in compliance with
      the License. You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

      */

      package org.apache.derbyTesting.functionTests.tests.lang;

      import java.sql.SQLException;
      import junit.framework.Test;
      import org.apache.derbyTesting.junit.BaseJDBCTestCase;
      import org.apache.derbyTesting.junit.TestConfiguration;

      /**

      • Bug repro.
        */
        public class ReproTest extends BaseJDBCTestCase {

      public ReproTest(String name)

      { super(name); }

      public static Test suite()

      { return TestConfiguration.clientServerDecorator( new ReproTest("testRepro")); }

      /**

      • repro
        */
        public void testRepro() throws SQLException { getTestConfiguration().shutdownEngine(); getConnection(); }

      }

        Activity

        Hide
        Kathey Marsden added a comment -

        Triaged for 10.5.2 and set Normal urgency. We should be able to reconnect after shutdown. It is not clear from the comments if it is necessary to bounce the server to get a new connection. If so this should probably marked Urgent for 10.6

        Show
        Kathey Marsden added a comment - Triaged for 10.5.2 and set Normal urgency. We should be able to reconnect after shutdown. It is not clear from the comments if it is necessary to bounce the server to get a new connection. If so this should probably marked Urgent for 10.6

          People

          • Assignee:
            Unassigned
            Reporter:
            Vemund Østgaard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development