As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
import org.alfresco.tools.Import; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * This class is a "wrapper" to: * - log errors using log4j * - return a "exit code" different from 0 when one error occurs. */ public final class ImportWrapper { protected static Log logger = LogFactory.getLog(ImportWrapper.class); public static void main(String[] args) { logger.debug("Start of import"); int exitCode = 1; try { Import.main(args); // OK exitCode = 0; } catch (Throwable t) { logger.error("ERROR DURING IMPORT:" + t.getMessage(), t); } logger.debug("End of import - exitCode=" + exitCode); System.exit(exitCode); } }