Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-6486

NPE when starting up server with wrong json prop file

    Details

    • Type: Bug
    • Status: Done
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 7.0.0
    • Fix Version/s: 7.0.0
    • Component/s: config
    • Labels:

      Description

      Regression found with 7.0.0-SNAPSHOT rev. dd9df5a85cd.

      Automated test:

       run-pybot.py -v -s commons_config_group.tokenresolution -t Json_Property_File_With_Wrong_Content DJ
      

      Manual steps:
      1. setup server with default values and don't start the server
      2. create tmp dir with wrong json token

      os.makedirs(os.path.join(self.tmp_dir, 'notokjson'))
      json_file = os.path.join(self.tmp_dir, 'notokjson', "notokjson.json")
      file.add_line_to_file(json_file, 'listen.port=5555')
      

      3. set env variable

      export DS_ENVCONFIG_DIRS=/path/to/notokjson
      

      4. configure HTTP handler to get listen-port value from env

      ./dsconfig --offline set-connection-handler-prop --handler-name "HTTP Connection Handler" --set listen-port:"&{listen.port}" -n
      

      5. start the server

      Current behavior:
      During start up (5.) there is error message with NPE:

      An error occurred while attempting to bootstrap the Directory Server: Cannot create the property resolver due to the following error: 'Failed to load JSON file /home/fuchsik/forks/pyforge/results/20190726-075947/commons_config_group/tmp/notokjson/notokjson.json'
      [26/Jul/2019:08:00:41 +0200] category=CORE severity=NOTICE msgID=139 msg=The Directory Server has sent an alert notification generated by class org.opends.server.core.DirectoryServer (alert type org.opends.server.DirectoryServerShutdown, alert ID org.opends.messages.core-141): The Directory Server has started the shutdown process. The shutdown was initiated by an instance of class org.opends.server.core.DirectoryServerShutdownHook and the reason provided for the shutdown was The Directory Server shutdown hook detected that the JVM is shutting down. This generally indicates that JVM received an external request to stop (e.g., through a kill signal)
      [26/Jul/2019:08:00:41 +0200] category=CORE severity=ERROR msgID=140 msg=An uncaught exception during processing for thread Directory Server Shutdown Hook has caused it to terminate abnormally. The stack trace for that exception is: NullPointerException (DirectoryServer.java:3530 DirectoryServer.java:3363 DirectoryServerShutdownHook.java:53)
      
      [26/Jul/2019:08:00:41 +0200] category=CORE severity=NOTICE msgID=139 msg=The Directory Server has sent an alert notification generated by class org.opends.server.api.DirectoryThread (alert type org.opends.server.UncaughtException, alert ID org.opends.messages.core-140): An uncaught exception during processing for thread Directory Server Shutdown Hook has caused it to terminate abnormally. The stack trace for that exception is: NullPointerException (DirectoryServer.java:3530 DirectoryServer.java:3363 DirectoryServerShutdownHook.java:53)
      

      Expected behavior:
      We expect the notice message with message Failed to load JSON file... The NPE is not expected and the test checks there is no NPE.

        Attachments

          Activity

            People

            • Assignee:
              JnRouvignac Jean-Noël Rouvignac
              Reporter:
              ondrej.fuchsik Ondrej Fuchsik
              QA Assignee:
              Ondrej Fuchsik
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: