jlolling / talendcomp_tJobInstance

Talend User Components to work with the cimt framework for batch jobs. These components are developed as cooperation between cimt AG and Jan Lolling
Apache License 2.0
14 stars 7 forks source link

compilation error in talend 7.3.1 #23

Closed rbtrtr closed 3 years ago

rbtrtr commented 4 years ago

Talend 7.3.1 doesn't provide log4j anymore. This causes compilation errors when using tJobInstance components. The tJobInstanceEnd part contains code to close appenders even if log4j is not explicitly activated in tJobInstanceStart component. The marked line with --> error causes the compilation error

// close all other known appenders in this job
for (java.util.Map.Entry<String, Object> entry : globalMap.entrySet()) {
    if (entry.getKey().endsWith("_APPENDER")) {
        Object object = entry.getValue();
        if (object instanceof org.apache.log4j.Appender) {
            // detach appender
--> error           org.apache.log4j.Logger.getLogger("talend")
                    .removeAppender((org.apache.log4j.Appender) object);
            try {
                // close appender
                ((org.apache.log4j.Appender) object).close();
            } catch (Throwable t) {
                // ignore errors
            }
        }
    }
}
jlolling commented 3 years ago

Log4J framework removed. We will put logging into a separate component.