From c947423c18b9ec552acdc141293c942d8d0b4a30 Mon Sep 17 00:00:00 2001 From: memeeerit Date: Thu, 30 Nov 2023 14:20:06 -0500 Subject: [PATCH] null db fix in mitre --- .../main/java/edu/rit/se/nvip/ReconcilerMain.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/reconciler/src/main/java/edu/rit/se/nvip/ReconcilerMain.java b/reconciler/src/main/java/edu/rit/se/nvip/ReconcilerMain.java index 306ed2e2..4994fd16 100644 --- a/reconciler/src/main/java/edu/rit/se/nvip/ReconcilerMain.java +++ b/reconciler/src/main/java/edu/rit/se/nvip/ReconcilerMain.java @@ -67,12 +67,6 @@ public static void main(String[] args) throws Exception { Reconciler reconciler = ReconcilerFactory.createReconciler(ReconcilerEnvVars.getReconcilerType()); reconciler.setKnownCveSources(ReconcilerEnvVars.getKnownSourceMap()); - NvdCveController nvdController = new NvdCveController(); - nvdController.createDatabaseInstance(); - - MitreCveController mitreController = new MitreCveController(); - mitreController.initializeController(); - DataSource ds = DatabaseHelper.getInstance().getDataSource(); RawDescriptionRepository rawRepo = new RawDescriptionRepository(ds); VulnerabilityRepository vulnRepo = new VulnerabilityRepository(ds); @@ -80,6 +74,14 @@ public static void main(String[] args) throws Exception { NvdMitreRepository nmRepo = new NvdMitreRepository(ds); RunHistoryRepository rhRepo = new RunHistoryRepository(ds); + NvdCveController nvdController = new NvdCveController(); + nvdController.createDatabaseInstance(); + + MitreCveController mitreController = new MitreCveController(); + mitreController.setDatabaseHelper(nmRepo); + mitreController.initializeController(); + + ReconcilerController rc = new ReconcilerController(rawRepo, vulnRepo, charRepo, nmRepo, rhRepo, filterHandler, reconciler, nvdController, mitreController); Messenger messenger = new Messenger(connectionFactory, inputQueueName, outputQueueName, rc);