Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-375

Specification of incomplete server properties on command line causes NPE with NetworkServerControl when starting the server.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.1.0, 10.2.1.6
    • 10.1.2.1, 10.2.1.6
    • Network Server
    • None
    • Running Derby Network Server and using command line API to start the server.

    Description

      When using the command line to start the Network Server, there a couple of cases where if a property is specified on the command line but no value is given (ex. "-Dderby.drda.maxThreads" instead of "-Dderby.drda.maxThreads=3"), a Null Pointer Exception will result, when the correct behavior should be to use some kind of default.

      For example:

      > java -Dderby.drda.maxThreads org.apache.derby.drda.NetworkServerControl start -p 1528
      java.lang.NullPointerException
      at org.apache.derby.impl.drda.NetworkServerControlImpl.localizeMessage(NetworkServerControlImpl.java)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessageWork(NetworkServerControlImpl.java)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessage(NetworkServerControlImpl.java)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.getIntPropVal(NetworkServerControlImpl.java)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.getPropertyInfo(NetworkServerControlImpl.java)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.<init>(NetworkServerControlImpl.java)
      at org.apache.derby.drda.NetworkServerControl.main(NetworkServerControl.java)

      Note that even though we see this NPE, it appears that the server still starts up, although the startup may not be complete (subsequent attempts to connect might lead to errors like "Invalid reply from network server: Insufficient data.").

      For other properties, this will just result in the default value being used, which is the correct behavior. For example:

      > java -Dderby.drda.host org.apache.derby.drda.NetworkServerControl start -p 1528
      Server is ready to accept connections on port 1528.

      Attachments

        1. derby-375.diff
          11 kB
          Deepa
        2. derby-375.status
          0.6 kB
          Deepa
        3. derbyall_report.txt
          13 kB
          Deepa

        Activity

          People

            deepa Deepa
            army A B
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: