Skip to content

Commit

Permalink
Orkweb Startup Fixes (#39)
Browse files Browse the repository at this point in the history
* orkweb: fix Log4jConfigFile
* Update ContextListener.java
* orkweb: remove old hibernate versions
  • Loading branch information
kingster authored Dec 1, 2020
1 parent f08e9e6 commit 2d1cd8a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion orkweb/context/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</context-param>
<context-param>
<param-name>Log4jConfigFile</param-name>
<param-value>logging.properties</param-value>
<param-value>logging.xml</param-value>
</context-param>
<context-param>
<param-name>HibernateConfigFile</param-name>
Expand Down
14 changes: 1 addition & 13 deletions orkweb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.sf.oreka</groupId>
<artifactId>orkweb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.2-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down Expand Up @@ -76,18 +76,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
</dependency>

<dependency>
<groupId>tapestry</groupId>
<artifactId>tapestry</artifactId>
Expand Down
15 changes: 11 additions & 4 deletions orkweb/src/net/sf/oreka/orkweb/ContextListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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("========================================");
Expand All @@ -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
Expand Down

0 comments on commit 2d1cd8a

Please sign in to comment.