From 2d1cd8a23ae4db36875a200dd5a474c26df9b43a Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Tue, 1 Dec 2020 12:28:00 +0530 Subject: [PATCH] Orkweb Startup Fixes (#39) * orkweb: fix Log4jConfigFile * Update ContextListener.java * orkweb: remove old hibernate versions --- orkweb/context/WEB-INF/web.xml | 2 +- orkweb/pom.xml | 14 +------------- .../src/net/sf/oreka/orkweb/ContextListener.java | 15 +++++++++++---- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/orkweb/context/WEB-INF/web.xml b/orkweb/context/WEB-INF/web.xml index 9efa1db4..a3918f11 100644 --- a/orkweb/context/WEB-INF/web.xml +++ b/orkweb/context/WEB-INF/web.xml @@ -13,7 +13,7 @@ Log4jConfigFile - logging.properties + logging.xml HibernateConfigFile diff --git a/orkweb/pom.xml b/orkweb/pom.xml index fee95084..728c9a23 100644 --- a/orkweb/pom.xml +++ b/orkweb/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sf.oreka orkweb - 0.0.1-SNAPSHOT + 0.0.2-SNAPSHOT war src @@ -76,18 +76,6 @@ provided - - org.hibernate - hibernate - 3.2.6.ga - - - - org.hibernate - hibernate-annotations - 3.3.1.GA - - tapestry tapestry diff --git a/orkweb/src/net/sf/oreka/orkweb/ContextListener.java b/orkweb/src/net/sf/oreka/orkweb/ContextListener.java index d098f41b..b92d2d03 100644 --- a/orkweb/src/net/sf/oreka/orkweb/ContextListener.java +++ b/orkweb/src/net/sf/oreka/orkweb/ContextListener.java @@ -40,8 +40,14 @@ public void contextInitialized(ServletContextEvent servletContextEvent) { log.error("OrkWeb ContextInitialized(): Log4jConfigFile context-param missing in web.xml"); } else { log4jConfigFile = configFolder + "/" + log4jConfigFile; - LogManager.getInstance().configure(log4jConfigFile); - log.info("OrkWeb ContextInitialized(): log4jConfigFile is " + log4jConfigFile); + try { + LogManager.getInstance().configure(log4jConfigFile); + log.info("OrkWeb ContextInitialized(): log4jConfigFile is " + log4jConfigFile); + } catch (Throwable e){ + e.printStackTrace(); + log.error("OrkWeb ContextInitialized(): Error configuring log4j: " + e.getMessage()); + } + } log.info("========================================"); @@ -58,8 +64,9 @@ public void contextInitialized(ServletContextEvent servletContextEvent) { try { OrkWeb.hibernateManager.configure(hibernateConfigFile); } - catch (Exception e) { - log.error("OrkWeb ContextInitialized(): Error configuring Hibernate: " + e.getMessage()); + catch (Throwable e) { + e.printStackTrace(); + log.error("OrkWeb ContextInitialized(): Error configuring Hibernate: " + e.getMessage()); } // Get path to server.xml file