Browse Source

Bugfix Kettle Env. #1

userinfo_gueltigkeit
Daniel Quathamer 11 months ago
parent
commit
f8e4e4ba91
  1. 11
      src/de/superx/servlet/SuperXManager.java
  2. 19
      src/de/superx/servlet/SxPool.java

11
src/de/superx/servlet/SuperXManager.java

@ -689,6 +689,11 @@ public class SuperXManager extends HttpServlet {
try { try {
initKettleEnv(); initKettleEnv();
} catch (Exception e) {
e.printStackTrace();
System.err.println("Kettle konnte nicht initialisiert werden.DETAILS:" + e.getMessage());
}
try {
SxPools.init(); SxPools.init();
initAll(); initAll();
@ -704,10 +709,12 @@ public class SuperXManager extends HttpServlet {
} }
} }
public final static void initKettleEnv() { public static void initKettleEnv() {
// init kettle environment // init kettle environment
try { try {
KettleEnvironment.init(); KettleEnvironment.init();
KettleLogStore.init();
logger.debug("Kettle environment sucessfully initialized.");
} catch (KettleException e) { } catch (KettleException e) {
logger.error("Couldn't initialize KettleEnvironment!", e); logger.error("Couldn't initialize KettleEnvironment!", e);
} }
@ -717,8 +724,6 @@ public class SuperXManager extends HttpServlet {
//DataSourceProviderFactory.setDataSourceProviderInterface(new KettleDataSourceProvider("default",logger)); //DataSourceProviderFactory.setDataSourceProviderInterface(new KettleDataSourceProvider("default",logger));
// init KettleLogStore // init KettleLogStore
KettleLogStore.init();
logger.debug("Kettle environment sucessfully initialized.");
} }
private final static class CacheUpdater extends Thread { private final static class CacheUpdater extends Thread {

19
src/de/superx/servlet/SxPool.java

@ -174,14 +174,19 @@ public class SxPool extends GenericObjectPool implements NamedObjectI {
lastpart = lastpart.replaceAll("\\?ApplicationName.*", ""); lastpart = lastpart.replaceAll("\\?ApplicationName.*", "");
String type = getDatabaseAbbr().equals("PG") ? "POSTGRESQL" : "INFORMIX"; String type = getDatabaseAbbr().equals("PG") ? "POSTGRESQL" : "INFORMIX";
// DatabaseMeta.getDatabaseInterfacesMap() ; // DatabaseMeta.getDatabaseInterfacesMap() ;
kettleDatabaseMeta = new DatabaseMeta("eduetl", type, "Native", host, lastpart, port, try {
props.getProperty("connectionName"), props.getProperty("password")); kettleDatabaseMeta = new DatabaseMeta("eduetl", type, "Native", host, lastpart, port,
if (lastpart.indexOf(":INFORMIXSERVER") > -1) { props.getProperty("connectionName"), props.getProperty("password"));
String ixServer = lastpart.substring(lastpart.indexOf(":INFORMIXSERVER") + 16); if (lastpart.indexOf(":INFORMIXSERVER") > -1) {
String dbname = lastpart.replaceAll(":INFORMIXSERVER=.*", ""); String ixServer = lastpart.substring(lastpart.indexOf(":INFORMIXSERVER") + 16);
kettleDatabaseMeta.setDBName(dbname); String dbname = lastpart.replaceAll(":INFORMIXSERVER=.*", "");
kettleDatabaseMeta.setServername(ixServer); kettleDatabaseMeta.setDBName(dbname);
kettleDatabaseMeta.setServername(ixServer);
}
} catch (Exception e1) {
System.err.println("Fehler bei Kettle DB Einrichtung: "+e1.toString());
e1.printStackTrace();
} }
ConnectionFactory connectionFactory = new DriverManagerConnectionFactory( ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
this.props.getProperty("connectionURL"), this.props); this.props.getProperty("connectionURL"), this.props);

Loading…
Cancel
Save