Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-10064

ConfigFileWatcher class should not try to reload a config file when no file has been created

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 7.68.0.Final
    • KieServer
    • None
    • False
    • None
    • False
    • NEW
    • NEW
    • ---
    • ---

    Description

      When a config file does not exist, the first time a watcher is created, it will try to reload a file which doesn't actually exist.

      This problem is due to the fact that the attribute "lastUpdate" is set to -1

      Scenario:

      • No config file exist and the the file watcher is created
      • lastUpdate is set to -1 - see
      • Then, once the watcher is started, it will reload the config file, even if the config file does not exist - see
      • This will cause an error, since the file might not exist:
        • 11:21:30.384 [pool-1-thread-1] ERROR ?.?:? - target/6e1fc47a-c8f8-44ec-b197-db82139d0b64/kie-server-router.json
          
          org.json.JSONException: A JSONObject text must begin with '{' at character 0
                  at org.json.JSONTokener.syntaxError(JSONTokener.java:410)
                  at org.json.JSONObject.<init>(JSONObject.java:179)
                  at org.kie.server.router.repository.ConfigurationMarshaller.unmarshall(ConfigurationMarshaller.java:94)
                  at org.kie.server.router.repository.FileRepository.load(FileRepository.java:65)
                  at org.kie.server.router.ConfigurationManager.syncPersistent(ConfigurationManager.java:92)
                  at org.kie.server.router.repository.ConfigFileWatcher.run(ConfigFileWatcher.java:88)
                  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
                  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                  at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
                  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                  at java.base/java.lang.Thread.run(Thread.java:829)
          

      Attachments

        Activity

          People

            gmunozfe@redhat.com Gonzalo Muñoz Fernández
            antferna Antonio Fernandez Alhambra (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: