异常日志的记录修改

web_backend_develope
chenlw 8 years ago
parent 32bd1be861
commit b57e8831cc

@ -122,15 +122,18 @@ public class BeanCopy {
field.set(dst, value);
// field.set(dst, field.get(src));
} catch (SecurityException e) {
log.error(e);
log.error(field.getName() + " is unsafe : SecurityException");
} catch (IllegalArgumentException e) {
log.error(e);
log.error(field.getName() + " is inexist or null or OutOfRange : ArgumentException ");
} catch (IllegalAccessException e) {
log.error(e);
log.error(field.getName() + " Access is false : AccessException");
} catch (NoSuchMethodException e) {
log.error(e.getMessage());
log.error(e);
} catch (InvocationTargetException e) {
log.error(e.getMessage());
log.error(e);
}
}
}
@ -155,7 +158,7 @@ public class BeanCopy {
Object obj = m.invoke(father);
f.set(dst, obj);
} catch (Exception e) {
log.error(e.getStackTrace());
log.error(e);
}
}
}

@ -90,9 +90,9 @@ public class Configs {
public static int dataBefore = 6;
/**
* excel12
* excel5
*/
public static int NUM_ONE_IMPORT_EXCEL = 12;
public static int NUM_ONE_IMPORT_EXCEL = 5;
/**
* docker oracle

@ -6,6 +6,7 @@ import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import com.platform.http.HttpClientConstant;
import com.platform.utils.excelUtils.ExcelOperation;
/** web
* @author chen
@ -109,6 +110,7 @@ public class ConfigsLoader implements ServletContextListener {
Constant.rootPasswd=properties.getProperty("gfs_control_rootPassWd").trim();
Constant.ganymedSSH = new GanymedSSH(Constant.hostIp, Constant.rootUser, Constant.rootPasswd, Constant.port);
ExcelOperation.initTemplate(Constant.EXCEL_TEMPLATE_INIT_ROW, Constant.EXCEL_TEMPLATE_TOTAL_COL);
}
public ConfigPropertyReader getcReader() {

@ -65,6 +65,9 @@ public class Constant {
/** excel模板真实数据的起始行数 */
public final static int EXCEL_TEMPLATE_INIT_ROW = 8;
/** excel模板的 总列 数 */
public final static int EXCEL_TEMPLATE_TOTAL_COL = 25;
/** excel导入-修改preDataInfo信息 */
public final static String preDataInfo_update = "修改";

@ -40,7 +40,7 @@ public class FileOperateHelper {
out.write(sb.toString().getBytes("utf-8"));
out.close();
} catch (IOException e) {
log.error(e.getStackTrace());
log.error(e);
}
}
@ -65,14 +65,14 @@ public class FileOperateHelper {
out.write(sb.toString().getBytes("utf-8"));
out.close();
} catch (IOException e) {
log.error(e.getStackTrace());
log.error(e);
}
finally{
if (null != out) {
try {
out.close();
} catch (IOException e) {
log.error(e.getStackTrace());
log.error(e);
}
}
}
@ -99,14 +99,14 @@ public class FileOperateHelper {
out.write(sb.toString().getBytes("GBK"));
out.close();
} catch (IOException e) {
log.error(e.getStackTrace());
log.error(e);
}
finally{
if (null != out) {
try {
out.close();
} catch (IOException e) {
log.error(e.getStackTrace());
log.error(e);
}
}
}
@ -132,14 +132,14 @@ public class FileOperateHelper {
sb.append(tempString).append("\r\n");
}
} catch (Exception e) {
log.error(e.getStackTrace());
log.error(e);
}
finally{
if (null != fis) {
try {
fis.close();
} catch (IOException e) {
log.error(e.getStackTrace());
log.error(e);
}
}
}
@ -168,14 +168,14 @@ public class FileOperateHelper {
sb.append(tempString+"\n");
}
} catch (Exception e) {
log.error(e.getStackTrace());
log.error(e);
}
finally{
if (null != fis) {
try {
fis.close();
} catch (IOException e) {
log.error(e.getStackTrace());
log.error(e);
}
}
}

@ -31,9 +31,9 @@ public class ProcessMyUtil {
result.add(line);
}
} catch (IOException e) {
logger.error(e.getStackTrace());
logger.error(e);
} catch (InterruptedException e) {
logger.error(e.getStackTrace());
logger.error(e);
}
return result;
}

@ -29,7 +29,7 @@ public class ThreadRemoveFile extends Thread {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
log.error(e.getStackTrace());
log.error(e);
}
List<String> tmpPathArr = new ArrayList<String>();
if (null != path4Delete && path4Delete.size() > 0) {

@ -63,6 +63,31 @@ public class XmlOperationByDom4j {
return issuccess;
}
public static boolean createNullXml(String fileName, String rootnode) {
boolean issuccess = false;
Document document = null;
try {
OutputFormat xmlFormat = OutputFormat.createPrettyPrint();
xmlFormat.setEncoding("UTF-8");
XMLWriter xmlWriter;
// <20>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD>ڣ<EFBFBD>
document = DocumentHelper.createDocument(); // <20><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>
Element root = document.addElement(rootnode);
// <20><><EFBFBD> node<64><65><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>
xmlWriter = new XMLWriter(new OutputStreamWriter(new FileOutputStream(new File(fileName)), "UTF-8"),
xmlFormat);
// <20><><EFBFBD><EFBFBD>д<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
xmlWriter.write(document); // д<><D0B4><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
xmlWriter.close();
issuccess = true;
} catch (Exception e) {
issuccess = false;
}
return issuccess;
}
public static boolean addNode2Xml(String fileName, String rootnode, List<Object> nodes) {
if (null == nodes || 0 ==nodes.size()) {
return false;

@ -31,7 +31,7 @@ public class ZipCompressUtils {
logger.info("压缩结束");
zos.close();
} catch (Exception e) {
logger.error(e.getStackTrace());
logger.error(e);
}
}
else {
@ -64,7 +64,7 @@ public class ZipCompressUtils {
writeFile(zos, file);
}
} catch (Exception e) {
logger.error(e.getStackTrace());
logger.error(e);
}
}

Loading…
Cancel
Save