From 1e03f74544951b1f2ba459d0e87f4a4c7f389099 Mon Sep 17 00:00:00 2001 From: Kamil Jarmusik Date: Fri, 17 Nov 2023 23:46:31 +0100 Subject: [PATCH] #2718 mapping path static resources3 - fixed MangoContextListener.initialized --- src/com/serotonin/mango/MangoContextListener.java | 2 +- src/org/scada_lts/dao/DAO.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/serotonin/mango/MangoContextListener.java b/src/com/serotonin/mango/MangoContextListener.java index 0d4445bcc6..52aed651fd 100644 --- a/src/com/serotonin/mango/MangoContextListener.java +++ b/src/com/serotonin/mango/MangoContextListener.java @@ -117,8 +117,8 @@ private void initialized(ServletContextEvent evt) { // Create all the stuff we need. constantsInitialize(ctx); freemarkerInitialize(ctx); - databaseInitialize(ctx); imageSetInitialize(ctx); + databaseInitialize(ctx); highestAlarmLevelServiceInitialize(); dataPointsNameToIdMapping(ctx); diff --git a/src/org/scada_lts/dao/DAO.java b/src/org/scada_lts/dao/DAO.java index 10340eabbc..a98526802a 100644 --- a/src/org/scada_lts/dao/DAO.java +++ b/src/org/scada_lts/dao/DAO.java @@ -25,6 +25,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.scada_lts.web.beans.ApplicationBeans; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; @@ -48,11 +49,11 @@ public class DAO { private DAO() { try { LOG.trace("Create DAO"); - DataSource ds = Common.ctx.getDatabaseAccess().getDataSource(); + DataSource ds = ApplicationBeans.getBean("databaseSource", DataSource.class); namedParamJdbcTemplate = new NamedParameterJdbcTemplate(ds); jdbcTemplate = new JdbcTemplate(ds); } catch (Exception e) { - LOG.error(e); + LOG.error(e.getMessage(), e); } }