Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r6072 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r6072 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r6072 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType
  • Date: Thu, 20 Dec 2012 12:18:54 +0000 (GMT)

Author: nordunet.behrmann
Date: 2012-12-20 12:18:54 +0000 (Thu, 20 Dec 2012)
New Revision: 6072

Modified:

trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/FlywayServletListener.java
Log:
perfsonar-java-sql-ma: Improved logging in Flyway integration servlet

Modified:
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/FlywayServletListener.java
===================================================================
---
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/FlywayServletListener.java
2012-12-19 07:58:15 UTC (rev 6071)
+++
trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/sqlType/FlywayServletListener.java
2012-12-20 12:18:54 UTC (rev 6072)
@@ -5,6 +5,7 @@
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
import org.perfsonar.base.auxiliary.components.jdbc.JdbcComponent;
+import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;

import javax.servlet.ServletContextEvent;
@@ -15,8 +16,15 @@
@Override
public void contextInitialized(ServletContextEvent servletContextEvent)
{
+ AuxiliaryComponentManager components;
try {
- AuxiliaryComponentManager components =
AuxiliaryComponentManager.getInstance();
+ components = AuxiliaryComponentManager.getInstance();
+ } catch (PerfSONARException e) {
+ System.err.println("Failed to load PerfSONAR configuration: " +
e.getMessage());
+ throw new RuntimeException("Failed to load PerfSONAR
configuration: " + e.getMessage(), e);
+ }
+
+ try {
JdbcComponent jdbc = (JdbcComponent)
components.getComponent(ComponentNames.JDBC);

Flyway flyway = new Flyway();
@@ -26,11 +34,9 @@
flyway.setLocations("db/migration/" + jdbc.getDialect());
flyway.migrate();
} catch (FlywayException e) {
- System.err.println("Failed to initialize database: " +
e.getMessage());
+ ((LoggerComponent)
components.getComponent(ComponentNames.LOGGER))
+ .fatal("Failed to initialize database: " + e.getMessage());
throw new RuntimeException("Failed to initialize database: " +
e.getMessage(), e);
- } catch (PerfSONARException e) {
- System.err.println("Failed to initialize database: " +
e.getMessage());
- throw new RuntimeException("Failed to initialize database: " +
e.getMessage(), e);
}
}




  • [pS-dev] [GEANT/SA2/ps-java-services] r6072 - trunk/perfsonar-java-sql-ma/src/main/java/org/perfsonar/se rvice/measurementArchive/sqlType, svn-noreply, 12/20/2012

Archive powered by MHonArc 2.6.16.

Top of Page